javascript - leaflet use satellite view, drupal 8? -


satellite view

i need instead of basic view in leaflet (it's map of world), satellite view, still need able switch between them? how work, can explain me?

installed modules:

https://www.drupal.org/project/gmap

https://www.drupal.org/project/leaflet_more_maps

without using external plugin :

gpxpod.map = new l.map('map', {     zoomcontrol: true });  var osmurl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmattribution = 'map data &copy; 2013 <a href="http://openstreetmap'+ '.org">openstreetmap</a> contributors'; var osm = new l.tilelayer(osmurl, {maxzoom: 18, attribution: osmattribution});  var esriaerialurl = 'https://server.arcgisonline.com/arcgis/rest/services'+ '/world_imagery/mapserver/tile/{z}/{y}/{x}'; var esriaerialattrib = 'tiles &copy; esri &mdash; source: esri, i-cubed, '+ 'usda, usgs, aex, geoeye, getmapping, aerogrid, ign, igp, upr-egp, , the'+ ' gis user community'; var esriaerial = new l.tilelayer(esriaerialurl,     {maxzoom: 18, attribution: esriaerialattrib});  var gurl = 'http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}'; var gattribution = 'google'; var googlesat = new l.tilelayer(gurl, {maxzoom: 18, attribution: gattribution});  var baselayers = {     'openstreetmap': osm,     'esri aerial': esriaerial,     'google map sat': googlesat }  l.control.layers(baselayers, {}).addto(map); 

this piece of code adds standard control switch between tile provider layers. includes 2 satellite tile providers.

more info : http://leafletjs.com/reference-1.0.3.html#control-layers


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -