arcgis JavaScript 加载 mapbox地图

mapbox 地图现在是越来越好看了, 随便试

复制代码
/**
 * Created by Administrator on 2018/5/15 0015.
 */
import * as esriLoader from 'esri-loader'
import {mapBoxType} from "./MapBoxType"

export const mapBoxLayer = {};

mapBoxLayer.layerType = mapBoxType;

mapBoxLayer.addLayer = function (type,map) {

  esriLoader.dojoRequire([
      "esri/map",
      "esri/layers/WebTiledLayer"],
    function (Map,
              WebTiledLayer) {



      let url =  "https://${subDomain}.tiles.mapbox.com/v4/mapbox."+ type +"/${level}/${col}/${row}.png?access_token=pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g"
      let  webTileLayer = new WebTiledLayer(url, {
        "subDomains": ["a", "b", "c"]
      });
      map.addLayer(webTileLayer);

    })



}
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * Created by Administrator on 2018/5/15 0015.
 */
export const mapBoxType = {}
 
 
mapBoxType.streets = "streets";
 
mapBoxType.light = "light";
 
mapBoxType.dark = "dark";
 
mapBoxType.satellite = "satellite";
 
mapBoxType.streetsSatellite = "streets-satellite";
 
mapBoxType.wheatpaste = "wheatpaste";
 
mapBoxType.streetsBasic = "streets-basic";
 
mapBoxType.comic = "comic";
 
mapBoxType.outdoors = "outdoors";
 
mapBoxType.runBikeHike = "run-bike-hike";
 
mapBoxType.pencil = "pencil";
 
mapBoxType.pirates = "pirates";
 
mapBoxType.emerald = "emerald";
 
mapBoxType.highContrast = "high-contrast";

  

试arcgis加载mapbox 地图

posted @   haibalai  阅读(2374)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示