mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Use div icons instead of circleMarkers
This commit is contained in:
parent
29e4d599c1
commit
d7d78b7fc4
2 changed files with 19 additions and 2 deletions
|
|
@ -116,3 +116,9 @@ body {
|
|||
.category-filter .uncategorized a:after {
|
||||
border-color: #355C7D;
|
||||
}
|
||||
|
||||
.circle-marker {
|
||||
border-radius: 50%;
|
||||
border: 2px solid rgba(0,0,0,.5);
|
||||
background: rgba(0,0,0,.2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,10 +114,21 @@ class Visualization {
|
|||
*/
|
||||
setupMarkers () {
|
||||
this.data.forEach(incident => {
|
||||
var options = { color: this._pickColor(incident) }
|
||||
var marker = L.circleMarker([incident.lat, incident.lng], options)
|
||||
var icon = L.divIcon({
|
||||
className: 'circle-marker',
|
||||
iconSize: [18, 18]
|
||||
})
|
||||
|
||||
var options = { icon: icon }
|
||||
var marker = L.marker([incident.lat, incident.lng], options)
|
||||
.addTo(this.map)
|
||||
|
||||
var color = colorUtils.hexToRGB(this._pickColor(incident))
|
||||
$(marker._icon).css({
|
||||
borderColor: `rgba(${color[0]},${color[1]},${color[2]},.5)`,
|
||||
backgroundColor: `rgba(${color[0]},${color[1]},${color[2]},.2)`
|
||||
})
|
||||
|
||||
this._markers.set(incident, marker)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue