Antv L7 + mapbox 实现简单地图场景

实现场景

1.创建地图场景
在这里插入图片描述
2.自定义marker样式
在这里插入图片描述
3.mapbox 实现3D地图

代码实现

1.创建地图场景

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>创建地图场景</title>
    <style>
       html,body{
   overflow:hidden;margin:0;}
    	#map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/@antv/l7"></script>
<script src="https://webapi.amap.com/maps?v=1.4.8&key=15cd8a57710d40c9b7c0e3cc120f1200&plugin=Map3D"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.l7-1.3.0-beta.4/build/L7-min.js"></script>
<script>
  var scene = new L7.Scene({
   
    id: 'map',
    mapStyle: 'light', // 样式URL
    center: [108.947092, 34.260706],
    pitch: 0,
    zoom: 5,
	token: 'ec8e931ea3665171aa0b57d5a3aefa36',
  });
  scene.on('loaded', function() {
   
    $.getJSON('https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json', function(city) {
   
      var layer = scene.PolygonLayer().source(city).color('adcode', ['#b2182b', '#ef8a62', '#fddbc7', '#d1e5f0', '#67a9cf', '#2166ac'].reverse()).shape('fill').active(true).style({
   
        opacity: 2
      }).render();
      scene.PolygonLayer().source(city).color('#67a9cf').shape('line').style({
   
        opacity: 2
      
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值