Code example in wizard for leaflet has superfluous new keyword
Closed this issue · 5 comments
- click https://nlmaps.nl/#wizard
- click leaflet
- this the the example:
<div id="nlmaps-holder"></div>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var nlMapsHolder = document.getElementById('nlmaps-holder');
nlMapsHolder.style.height = '300px'; // Change to wanted height
var map = L.map('nlmaps-holder', { // ID of map div
center: [52.21119999999999, 5.9699],
layers: [
new L.tileLayer(
'https://geodata.nationaalgeoregister.nl/tiles/service/wmts/brtachtergrondkaart/EPSG:3857/{z}/{x}/{y}.png', {
attribution: 'NLMaps'
}
)
],
zoom: 10
});
</script>Noticenew L.tileLayer, which should be either new L.TileLayer or L.tileLayer.
Some other things I noticed:
- the attribution here is different from the one generated by the 'NL Maps Library'
- the mapbox example uses syntax
.setView([lat, lng], zoom)which I prefer over using the options object. - latlng precision is 14 decimal places, which is way more then ever needed (6 should be enough).
Als achtergrond bij laatste punt van @jieter zie Silly Geographic Precision.
This issue can be closed, I presume:
- Wizard now uses NL Maps library in the wizard instead of code specific to a mapping library e24d380#diff-51bd9925ed129615606366c8417dcd4e:
- Supersedes superfluous "new" in leaflet code
- Aligns the attribution
- No mapbox-specific implementation example
- Coordinate precision reduced to 6 decimals fb5af07
@jieter can you check?
@emacgillavry first diff is a bit big to quickly grasp what it's doing. For (2) code looks good, but not deployed/updated yet? I still see center: [52.21119999999999, 5.9699], on https://nlmaps.nl/#wizard.
@jieter no worries. Just to let you know that we have made that change in the code. Indeed, the wizard has not yet been updated to reflect changes in the code.
@jieter NL Maps wizard has been deployed to production! You'll also notice the coordinates only update once the map does not move or zoom anymore.