-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from open-oni/leaflet-update
Update Leaflet to latest release 1.5.1
- Loading branch information
Showing
14 changed files
with
26,082 additions
and
7,149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,63 @@ | ||
var map = L.map('map_container').setView(new L.LatLng(startLat, startLong), startZoom); | ||
|
||
// make base layer | ||
var stamenLayer = new L.StamenTileLayer(stamenType); | ||
map.addLayer(stamenLayer); | ||
|
||
// Uncomment the below if you would like to get the historical overlay working | ||
|
||
// the historical overlay | ||
// requires a tiling service | ||
// var overlay = new L.TileLayer.WMS("http://server:8080/geoserver/gwc/service/wms", { | ||
// layers: 'states:Nebraska_wma', | ||
// format: 'image/png', | ||
// transparent: true | ||
// }); | ||
// overlay.addTo(map); | ||
// | ||
// add a toggle for the two layers | ||
// L.control.layers({ "Plain" : stamenLayer, "Historical" : overlay }).addTo(map); | ||
|
||
|
||
var makeLinks = function(city, papers) { | ||
if (papers) { | ||
var res = "<h4>"+city+"</h4>"; | ||
for (var paper in papers) { | ||
res += singleLink(paper, papers[paper]) | ||
$(function() { | ||
var map = L.map('map_container').setView(new L.LatLng(startLat, startLong), startZoom); | ||
|
||
// make base layer | ||
var stamenLayer = new L.StamenTileLayer(stamenType); | ||
map.addLayer(stamenLayer); | ||
|
||
// Uncomment the below if you would like to get the historical overlay working | ||
|
||
// the historical overlay | ||
// requires a tiling service | ||
// var overlay = new L.TileLayer.WMS("http://server:8080/geoserver/gwc/service/wms", { | ||
// layers: 'states:Nebraska_wma', | ||
// format: 'image/png', | ||
// transparent: true | ||
// }); | ||
// overlay.addTo(map); | ||
// | ||
// add a toggle for the two layers | ||
// L.control.layers({ "Plain" : stamenLayer, "Historical" : overlay }).addTo(map); | ||
|
||
|
||
var makeLinks = function(city, papers) { | ||
if (papers) { | ||
var res = "<h4>"+city+"</h4>"; | ||
for (var paper in papers) { | ||
res += singleLink(paper, papers[paper]) | ||
} | ||
return res; | ||
} else { | ||
return "No papers found for this city"; | ||
} | ||
return res; | ||
} else { | ||
return "No papers found for this city"; | ||
} | ||
}; | ||
|
||
var singleLink = function(name, id) { | ||
return "<li class='map_paper_link'>" | ||
+"<a href='../lccn/" | ||
+id+"/'>"+name+"</a></li>"; | ||
}; | ||
|
||
var circleMarkers = { | ||
radius: 8, | ||
fillColor: markerColor, | ||
color: markerColor, | ||
weight: 1, | ||
opacity: 1, | ||
fillOpacity: .8 | ||
}; | ||
|
||
cities.forEach(function(city) { | ||
var marker = L.circleMarker(city["latlong"], circleMarkers); | ||
marker.addTo(map); | ||
marker.bindPopup(makeLinks(city["name"], city["papers"])); | ||
|
||
// add a mouseover that waits for you to click away before closing | ||
marker.on('mouseover', function(e) { | ||
this.openPopup(); | ||
}); | ||
marker.on('click', function(e) { | ||
this.closePopup(); | ||
}; | ||
|
||
var singleLink = function(name, id) { | ||
return "<li class='map_paper_link'>" | ||
+"<a href='../lccn/" | ||
+id+"/'>"+name+"</a></li>"; | ||
}; | ||
|
||
var circleMarkers = { | ||
radius: 8, | ||
fillColor: markerColor, | ||
color: markerColor, | ||
weight: 1, | ||
opacity: 1, | ||
fillOpacity: .8 | ||
}; | ||
|
||
cities.forEach(function(city) { | ||
var marker = L.circleMarker(city["latlong"], circleMarkers); | ||
marker.addTo(map); | ||
marker.bindPopup(makeLinks(city["name"], city["papers"])); | ||
|
||
// add a mouseover that waits for you to click away before closing | ||
marker.on('mouseover', function(e) { | ||
this.openPopup(); | ||
}); | ||
marker.on('click', function(e) { | ||
this.closePopup(); | ||
}); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.