humangeo / leaflet-dvf

Leaflet Data Visualization Framework
MIT License
689 stars 153 forks source link

Is it possible to define marker sizes with scale? [question] #111

Open cdrfun opened 7 years ago

cdrfun commented 7 years ago

Currently the marker sizes stay the same when I zoom in or out. Is it possible to stay in scale with those sizes? So I can define a marker should have a size of 10 km?

ymz1124 commented 7 years ago

I hope the size can be automatically changed when I zoom in or out, but I don't know how to do.

sfairgrieve commented 7 years ago

@cdrfun Sorry for the delayed response. One way of doing this is to use L.RegularPolygon or L.Circle, if you're ok with markers that are simple shapes. Does that meet your needs, or are you looking for image markers (L.Marker) that stay a fixed size?

cdrfun commented 7 years ago

@sfairgrieve It's ok, no hurries ;) I would want to use L.Marker, but if only L.RegularPolygon and L.Circle are capable of this feature, it will do.

For future reference: For circle it is: http://leafletjs.com/reference-1.0.3.html#circle-option And for Polygon: https://github.com/humangeo/leaflet-dvf/blob/master/src/leaflet.dvf.regularpolygon.js