resetView
This commit is contained in:
parent
14d86c06af
commit
8a2300578a
2 changed files with 32 additions and 2 deletions
17
lib/map.js
17
lib/map.js
|
|
@ -52,6 +52,8 @@ define(function () {
|
|||
var iconOffline = { color: "#D43E2A", radius: 6, fillOpacity: 0.5, weight: 2, className: "stroke-first" }
|
||||
var iconNew = { color: "#558020", radius: 6, fillOpacity: 0.5, weight: 2, className: "stroke-first" }
|
||||
|
||||
var groupOnline, group
|
||||
|
||||
return function (sidebar) {
|
||||
var self = this
|
||||
|
||||
|
|
@ -92,8 +94,13 @@ define(function () {
|
|||
.map(mkMarker(nodeDict, function (d) { return iconOnline }, gotoAnything))
|
||||
|
||||
var groupLines = L.featureGroup(lines).addTo(map)
|
||||
var groupOnline = L.featureGroup(onlinemarkers).addTo(map)
|
||||
var group = L.featureGroup(markers).addTo(map)
|
||||
groupOnline = L.featureGroup(onlinemarkers).addTo(map)
|
||||
group = L.featureGroup(markers).addTo(map)
|
||||
resetView()
|
||||
}
|
||||
|
||||
function resetView() {
|
||||
resetMarkerStyles(nodeDict, linkDict)
|
||||
|
||||
var bounds = group.getBounds()
|
||||
|
||||
|
|
@ -135,6 +142,8 @@ define(function () {
|
|||
return m
|
||||
}
|
||||
|
||||
self.resetView = resetView
|
||||
|
||||
self.gotoNode = function (d) {
|
||||
resetMarkerStyles(nodeDict, linkDict)
|
||||
|
||||
|
|
@ -142,6 +151,8 @@ define(function () {
|
|||
|
||||
if (m)
|
||||
m.setStyle({ fillColor: m.options.color, color: "orange", weight: 20, fillOpacity: 1, opacity: 0.7 })
|
||||
else
|
||||
resetView()
|
||||
}
|
||||
|
||||
self.gotoLink = function (d) {
|
||||
|
|
@ -151,6 +162,8 @@ define(function () {
|
|||
|
||||
if (m)
|
||||
m.setStyle({ weight: 7, opacity: 1, dashArray: "10, 10" })
|
||||
else
|
||||
resetView()
|
||||
}
|
||||
|
||||
return self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue