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

Commit d9a0b84

Browse files
Nabeel Shahzadnabeelio
authored andcommitted
Allow provider override; add icon sizes
1 parent 3da0f28 commit d9a0b84

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

core/templates/route_map.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ const map = createMap({
7373
7474
const depCoords = L.latLng(<?php echo $mapdata->deplat?>, <?php echo $mapdata->deplng;?>);
7575
const depMarker = L.marker(depCoords, {
76-
icon: L.icon({ iconUrl: depicon })
76+
icon: L.icon({ iconUrl: depicon, iconSize: [35, 35] })
7777
}).bindPopup("<?php echo $mapdata->depname;?>").addTo(map);
7878
7979
const arrCoords = L.latLng(<?php echo $mapdata->arrlat?>, <?php echo $mapdata->arrlng;?>);
8080
const arrMarker = L.marker(arrCoords, {
81-
icon: L.icon({ iconUrl: arricon })
81+
icon: L.icon({ iconUrl: arricon, iconSize: [35, 35] })
8282
}).bindPopup("<?php echo $mapdata->arrname;?>").addTo(map);
8383
8484
const icon_vor = L.icon({
@@ -93,6 +93,7 @@ const icon_fix = L.icon({
9393
// for drawing the line
9494
let points = [];
9595
points.push(depCoords);
96+
9697
<?php
9798
if(is_array($mapdata->route_details)) {
9899
foreach($mapdata->route_details as $route) {
@@ -121,7 +122,6 @@ if(is_array($mapdata->route_details)) {
121122
})
122123
.bindPopup(tmpl("navpoint_bubble", {nav: v<?php echo $route->name?>_info}))
123124
.addTo(map);
124-
125125
<?php
126126
}
127127
}

lib/js/base_map.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const createMap = (opts) => {
1010
maxZoom: 10,
1111
layers: [],
1212
set_marker: false,
13+
provider: 'OpenStreetMap.Mapnik',
1314
}, opts);
1415

1516
const openaip_basemap_phys_osm = L.featureGroup(feature_groups);
@@ -23,7 +24,7 @@ const createMap = (opts) => {
2324
// http://leaflet-extras.github.io/leaflet-providers/preview/
2425
// Just set the provider name that you want below, or add additional
2526
// Some providers require an API key, so just look out for that
26-
L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map);
27+
L.tileLayer.provider(opts.provider).addTo(map);
2728

2829
return map
2930
};

0 commit comments

Comments
 (0)