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);

    })



}
/**
 * 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 地圖


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM