Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including maptalks-tilelayercollection with all npm packages installed. Try it out:

var maptalksTilelayercollection = require("maptalks-tilelayercollection")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

maptalks-tilelayercollection v0.0.1

a tilelayer collection

this is TileLayer collection

Contain Tdt(天地图),AMap(高德地图),Geoq(智图),Google,Tencent(腾讯),Osm,CartoDb,Mapbox

demo

example code

var id='helle-world-layer'

  var map = new maptalks.Map('map', {
    center: [120,31.49856],
    zoom: 5
  });

  var tileLayer=maptalks.TileLayerCollection.getTdtTileLayer(id,{style:'Terrain'});
  map.setBaseLayer(tileLayer)

List all the cases

var tileLayer=maptalks.TileLayerCollection.getTdtTileLayer(id,{style:'Terrain'||'Normal'||'Satellite'});



var tileLayer=maptalks.TileLayerCollection.getGeoqTileLayer(id,{style:'Colour'||'Gray'||'Midnightblue'});



var tileLayer=maptalks.TileLayerCollection.getGoogleTileLayer(id,{style:'Normal'||'Satellite'});



var tileLayer=maptalks.TileLayerCollection.getAmapTileLayer(id,{style:'Normal'||'Satellite'});



var tileLayer=maptalks.TileLayerCollection.getTencentTileLayer(id,{style:'Normal'||'Satellite'||'Terrain'});



var tileLayer=maptalks.TileLayerCollection.getOsmTileLayer(id,{style:'Normal'||'Bike'||'Transport'||'Humanitarian'});



var tileLayer=maptalks.TileLayerCollection.getCartoDbTileLayer(id,{style:'Dark'||'Light'});



var tileLayer=maptalks.TileLayerCollection.getMapboxTileLayer(id,{style:'Streets'||'Dark'||'LightDark'||'Satellite'||'Light'||'Emerald'||'White'||'Red'||'Outdoors'||'StreetsSatellite'||'Comic'||'Building'});
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free