| Sjoerddebruin edited the task description. (Show Details) |
EDIT DETAILS
Here's the code I currently have:
```
if ($("table.wb-globe-details").length) {
$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css') );
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js", function () {
$("table.wb-globe-details").each(function (i) {
$(this).find("tbody").append("<tr><td colspan=2><div id='mapmapmap"+i+"' style='height:300px; min-width:500px'></div></td></tr>");
var lat = $(this).find("td.wb-globe-latitude").text();
var lon = $(this).find("td.wb-globe-longitude").text();
var map = L.map('mapmapmap'+i).setView([lat, lon], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
maxZoom: 18
}).addTo(map);
var marker = L.marker([lat, lon]).addTo(map);
});
});
}
```org/wiki/Zoom_levels though
...
- it currently always uses the same zoom level - it seems like it should be possible to come up with an appropriate zoom level using the precision of the coordinates, but I haven't looked into that either. A quick search did find http://wiki.openstreetmap.org/wiki/Zoom_levels thoughHere's the code I currently have:
```
if ($("table.wb-globe-details").length) {
$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css') );
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js", function () {
$("table.wb-globe-details").each(function (i) {
$(this).find("tbody").append("<tr><td colspan=2><div id='mapmapmap"+i+"' style='height:300px; min-width:500px'></div></td></tr>");
var lat = $(this).find("td.wb-globe-latitude").text();
var lon = $(this).find("td.wb-globe-longitude").text();
var map = L.map('mapmapmap'+i).setView([lat, lon], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
maxZoom: 18
}).addTo(map);
var marker = L.marker([lat, lon]).addTo(map);
});
});
}
```org/wiki/Zoom_levels though
TASK DETAIL
EMAIL PREFERENCES
To: Sjoerddebruin
Cc: Yurik, Lydia_Pintscher, Sjoerddebruin, Ricordisamoa, Nikki, Aklapper, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331
Cc: Yurik, Lydia_Pintscher, Sjoerddebruin, Ricordisamoa, Nikki, Aklapper, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
