React-leaflet: add support for divicon

Created on 24 Jul 2016  路  4Comments  路  Source: PaulLeCam/react-leaflet

Leaflet api now has divicon support can we add it to react-leaflet.
Or it's trivial to add, and we can do it outside of this library

Most helpful comment

The example you provided is nice, but it doesn't use any custom HTML. Is it possible to have react generated HTML (JSX) into that leaflet divIcon?

All 4 comments

Hi, you can already use DivIcons, you simply need to generate them from Leaflet, ex:

import { divIcon } from 'leaflet'
import { Marker } from 'react-leaflet'

const icon = divIcon({className: 'my-div-icon'})
const marker = <Marker icon={icon} ... />

Really nice thanks

The example you provided is nice, but it doesn't use any custom HTML. Is it possible to have react generated HTML (JSX) into that leaflet divIcon?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

acpower7 picture acpower7  路  4Comments

josdejong picture josdejong  路  4Comments

kaitlynbrown picture kaitlynbrown  路  3Comments

farahabdi picture farahabdi  路  3Comments

gane5h picture gane5h  路  3Comments