Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit 3da0f28

Browse files
Nabeel Shahzadnabeelio
authored andcommitted
Add leaflet-providers
1 parent 1aab1f3 commit 3da0f28

File tree

3 files changed

+754
-12
lines changed

3 files changed

+754
-12
lines changed

lib/js/base_map.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44

55
const createMap = (opts) => {
6-
76
opts = Object.assign({
87
render_elem: 'map',
98
center: [29.98139, -95.33374],
@@ -13,23 +12,18 @@ const createMap = (opts) => {
1312
set_marker: false,
1413
}, opts);
1514

16-
let feature_groups = [];
17-
const opencyclemap_phys_osm = new L.TileLayer(
18-
'https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
19-
maxZoom: 15,
20-
noWrap: true,
21-
attribution: 'Map tiles by Carto, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
22-
});
23-
24-
feature_groups.push(opencyclemap_phys_osm);
25-
2615
const openaip_basemap_phys_osm = L.featureGroup(feature_groups);
2716
let map = L.map(opts.render_elem, {
28-
layers: [openaip_basemap_phys_osm],
2917
center: opts.center,
3018
zoom: opts.zoom,
3119
scrollWheelZoom: false,
3220
});
3321

22+
// Want to customizer the basemap? Look at the leaflet-providers page:
23+
// http://leaflet-extras.github.io/leaflet-providers/preview/
24+
// Just set the provider name that you want below, or add additional
25+
// Some providers require an API key, so just look out for that
26+
L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
27+
3428
return map
3529
};

0 commit comments

Comments
 (0)