Use div icons instead of circleMarkers

This commit is contained in:
Arne Schlüter 2015-02-08 16:53:00 +01:00
commit d7d78b7fc4
2 changed files with 19 additions and 2 deletions

View file

@ -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);
}

View file

@ -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)
})