Added Leaflet.DivIcon for icon type (#14736)

* Added Leaflet.DivIcon for icon type

* Changed icon to BaseIcon type, as per @danzel suggestion
This commit is contained in:
pegel03 2017-03-11 01:04:05 +01:00 committed by Mohamed Hegazy
parent e157eb1dd1
commit 2addedb15e
2 changed files with 13 additions and 1 deletions

View File

@ -111,7 +111,7 @@ interface LayerProps extends LeafletInteractionEvents {
interface MarkerProps extends LayerProps, LeafletDraggingEvents {
position: Leaflet.LatLngExpression;
draggable?: boolean;
icon?: Leaflet.Icon;
icon?: Leaflet.BaseIcon;
zIndexOffset?: number;
opacity?: number;
}

View File

@ -179,6 +179,18 @@ export class CustomComponent extends Component<any, any> {
}
}
export class MarkerWithDivIconExample extends Component<any, any> {
render() {
return (
<Map>
<Marker position={[0, 0]} icon={
new Leaflet.DivIcon({})
}/>
</Map>
)
}
}
// draggable-marker.js
export class DraggableExample extends Component<any, any> {
state = {