Skip to content

Commit

Permalink
Merge pull request #4 from atd-schubert/master
Browse files Browse the repository at this point in the history
#3: Add world map to leaflet-example
  • Loading branch information
mks85 committed Dec 30, 2014
2 parents e084e0e + 937c076 commit 25202e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions mein-leaflet.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
right:0;
}

#mini-wolrd-map {
#mini-world-map {
position: absolute;
height:150px;
width: 200px;
bottom:25px;
right:25px;
border: 1px solid black;
background-color:red;
}
16 changes: 15 additions & 1 deletion mein-leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$(document).ready(function(){
// Create Map
var map = L.map('map').setView([50.739, 7.117], 13);

// Connect osm with leaflet
var osmUrl = "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
var osmLayer = new L.TileLayer(osmUrl, {maxZoom:18, attribution:"OpenStreetmap"});
Expand All @@ -15,4 +14,19 @@ $(document).ready(function(){
marker.addTo(map);
// Add a popup to marker
marker.bindPopup("Bonn-Beuel").closePopup();




// Create mini worldMap
var miniWorldMap = L.map('mini-world-map').setView([50.739, 7.117], 0);

// Connect osm with leaflet
var osmWorldLayer = new L.TileLayer(osmUrl, {maxZoom:3, attribution:"OpenStreetmap"});
osmWorldLayer.addTo(miniWorldMap);

// create same marker
var marker = new L.marker([50.739, 7.117]);
// Connect marker to map
marker.addTo(miniWorldMap);
});

0 comments on commit 25202e1

Please sign in to comment.