mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Add more information to popup windows
This commit is contained in:
parent
f4e1833c24
commit
d259b71231
2 changed files with 31 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ import './lib/oms.min'
|
|||
|
||||
import filter from './filter'
|
||||
import colorUtils from './colors'
|
||||
import template from './popup'
|
||||
|
||||
class Visualization {
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ class Visualization {
|
|||
|
||||
this.oms.legColors = {
|
||||
usual: 'rgba(0,0,0,.2)',
|
||||
highlighted: 'rgba(0,0,0,.5)'
|
||||
highlighted: 'rgba(0,0,0,.6)'
|
||||
}
|
||||
|
||||
var popup = new L.Popup({
|
||||
|
|
@ -40,7 +41,7 @@ class Visualization {
|
|||
if (map.getZoom() < 10)
|
||||
map.setZoom(9)
|
||||
|
||||
popup.setContent(marker.description.replace(/\n/g, '<br>'))
|
||||
popup.setContent(template(marker.incident))
|
||||
popup.setLatLng(marker.getLatLng())
|
||||
map.openPopup(popup)
|
||||
})
|
||||
|
|
@ -165,7 +166,7 @@ class Visualization {
|
|||
var marker = L.marker([incident.lat, incident.lng], options)
|
||||
.addTo(this.map)
|
||||
|
||||
marker.description = incident.description
|
||||
marker.incident = incident
|
||||
|
||||
var color = colorUtils.hexToRGB(this._pickColor(incident))
|
||||
$(marker._icon).css({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue