butiker
HTML
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.css">
<script src="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet.js"></script>
<div id="map" style="width: 600px; height: 400px"></div>
JavaScript
var butik = {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[12.864196,56.669145]},"properties":{"Butik":"<br><b>Halmstad C</b> <br>Öppettider: "}},{"type":"Feature","geometry":{"type":"Point","coordinates":[12.861353,56.674303]},"properties":{"Butik":"<br><b>Österskans</b> <br>Öppettider: "}},{"type":"Feature","geometry":{"type":"Point","coordinates":[12.487378,56.902172]},"properties":{"Butik":"<br><b>Holgersplan</b> <br>Öppettider: "}},{"type":"Feature","geometry":{"type":"Point","coordinates":[12.248919,57.109303]},"properties":{"Butik":"<br><b>Varberg Station</b><br>Öppettider:"}}]}
var map = L.map('map', {
zoomControl: false,
zoomsliderControl: true,
}).setView([56.755, 12.744], 9);
L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
maxZoom: 18,
minZoom: 7,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'thesuss.il83j2a3'
// id: 'examples.map-i86knfo3'
}).addTo(map);
butiker = L.geoJson(butik, {
pointToLayer: function(feature, latlng) {
return new L.Marker(latlng);
},
onEachFeature: function (feature, layer) {
layer.bindPopup("Kundservicebutik: " + feature.properties.Butik);
}
});
var overlays = {
"Butiker": butiker
};
// Lägg in de olika lagren
L.control.layers(null,overlays).addTo(map);