Skip to content

Commit

Permalink
Merge pull request #8 from open-oni/leaflet-update
Browse files Browse the repository at this point in the history
Update Leaflet to latest release 1.5.1
  • Loading branch information
jechols authored Sep 16, 2019
2 parents af34254 + bdba5eb commit 56ea0a3
Show file tree
Hide file tree
Showing 14 changed files with 26,082 additions and 7,149 deletions.
118 changes: 60 additions & 58 deletions static/js/map.js
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();
});
});
});
Binary file modified static/vendor/leaflet/images/layers-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/vendor/leaflet/images/layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/vendor/leaflet/images/marker-icon-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/vendor/leaflet/images/marker-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/vendor/leaflet/images/marker-shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 56ea0a3

Please sign in to comment.