Skip to content

Commit 9c99f97

Browse files
committed
Add scale on all map
Fix items translation
1 parent dff9f6c commit 9c99f97

6 files changed

Lines changed: 7 additions & 6 deletions

File tree

admin/admin_photo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
$js = "\nvar map = L.map('map', { 'zoomControl': false, editInOSMControlOptions: { editors: ['id'] }, }).setView([".$lat.", ".$lon."], ".$zoom.");
128128
129129
L.tileLayer('".$baselayerurl."', { maxZoom: 18 }).addTo(map);
130-
130+
L.control.scale().addTo(map);
131131
map.addControl(L.control.zoom({position: 'topleft'}));
132132
133133
L.marker([".$lat.", ".$lon."]).addTo(map)

admin/admin_photo.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
map.on('click', onMapClick);
8686

8787
/* BEGIN leaflet-search */
88-
var jsonpurl = 'http://open.mapquestapi.com/nominatim/v1/search.php?q={s}'+
88+
var jsonpurl = 'https://open.mapquestapi.com/nominatim/v1/search.php?q={s}'+
8989
'&format=json&osm_type=N&limit=100&addressdetails=0',
9090
jsonpName = 'json_callback';
9191
//third party jsonp service

category.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function osm_render_category_description()
6060
$height = isset($conf['osm_conf']['category_description']['height']) ? $conf['osm_conf']['category_description']['height'] : '200';
6161
$width = isset($conf['osm_conf']['category_description']['width']) ? $conf['osm_conf']['category_description']['width'] : 'auto';
6262
$js = osm_get_js($conf, $local_conf, $js_data);
63-
$template->set_filename('map', dirname(__FILE__).'/template/osm-index.tpl' );
63+
$template->set_filename('map', dirname(__FILE__).'/template/osm-category.tpl' );
6464
$template->assign(
6565
array(
6666
'CONTENT_ENCODING' => get_pwg_charset(),

include/functions_map.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ function osm_get_js($conf, $local_conf, $js_data)
254254
latlng = new L.LatLng(".$local_conf['center_lat'].", ".$local_conf['center_lng'].");\n";
255255
$js .= "var " . $divname . " = new L.Map('" . $divname . "', {" . $worldcopyjump . ", center: latlng, zoom: ".$local_conf['zoom'].", layers: [TileLayer], contextmenu: " . $local_conf['contextmenu'] . "});\n";
256256
$js .= $divname . ".attributionControl.setPrefix('');\n";
257+
$js .= "L.control.scale().addTo(map);\n";
257258
$js .= "var MarkerClusterList=[];\n";
258259
$js .= "if (typeof L.MarkerClusterGroup === 'function')\n";
259260
$js .= " var markers = new L.MarkerClusterGroup();\n";

template/osm-map2.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ function toggle(arrow)
471471
}
472472
}
473473
/* Update items counts */
474-
document.getElementById("nb_showall").innerHTML = {/literal}{'ITEMS'|@translate}{literal};
474+
document.getElementById("nb_showall").innerHTML = nb_items +' items';
475475
476476
/* Update jcarousel and all witdh*/
477477
if (nb_items>0) {
@@ -532,9 +532,9 @@ function toggle(arrow)
532532
/* BEGIN leaflet Location */
533533
function onLocationFound(e) {
534534
var radius = e.accuracy / 2;
535-
var str = {/literal}{'METERS_FROM_POINT'|@translate}{literal};
535+
var str = '{/literal}{'METERS_FROM_POINT'|@translate}{literal}';
536536
L.marker(e.latlng).addTo(map)
537-
.bindPopup(str.replace('%d', radius)).openPopup();
537+
.bindPopup(str.replace('%s', radius)).openPopup();
538538
539539
L.circle(e.latlng, radius).addTo(map);
540540
}

0 commit comments

Comments
 (0)