|
@@ -5,6 +5,28 @@ define(["d3", "leaflet", "moment", "locationmarker", "leaflet.label",
|
|
|
zoomControl: false
|
|
|
}
|
|
|
|
|
|
+ var AddLayerButton = L.Control.extend({
|
|
|
+ options: {
|
|
|
+ position: "bottomright"
|
|
|
+ },
|
|
|
+
|
|
|
+ initialize: function (f, options) {
|
|
|
+ L.Util.setOptions(this, options)
|
|
|
+ this.f = f
|
|
|
+ },
|
|
|
+
|
|
|
+ onAdd: function () {
|
|
|
+ var button = L.DomUtil.create("button", "add-layer")
|
|
|
+
|
|
|
+ L.DomEvent.disableClickPropagation(button)
|
|
|
+ L.DomEvent.addListener(button, "click", this.f, this)
|
|
|
+
|
|
|
+ this.button = button
|
|
|
+
|
|
|
+ return button
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
var LocateButton = L.Control.extend({
|
|
|
options: {
|
|
|
position: "bottomright"
|
|
@@ -156,6 +178,10 @@ define(["d3", "leaflet", "moment", "locationmarker", "leaflet.label",
|
|
|
|
|
|
map.addControl(locateUserButton)
|
|
|
|
|
|
+ map.addControl(new AddLayerButton(function () {
|
|
|
+ L.tileLayer.provider(prompt()).addTo(map)
|
|
|
+ }))
|
|
|
+
|
|
|
var nodeDict = {}
|
|
|
var linkDict = {}
|
|
|
var highlight
|