javascript - How do I resize SVG images on a map as the zoom level changes? -


i'm using leaflet allow uses draw custom svg paths (polygons) on map. problem when user zooms out, polygon becomes large , obscures rest of map.

i've looked online examples, , resources i've come across uses geo functions d3.geo library. whereas in use case i'm using d3, leaflet, , svg layer on map.

is there formula can apply resize objects correctly? know have apply translate function based on width height , current zoom level, wondering if there standard way this?

edit: here 1 resource found, uses d3 geofunctions, , can gather, seems redraw polygons every time map view reset (which might inefficient(?)

http://www.d3noob.org/2014/03/leafletjs-map-with-d3js-objects-that.html

just apply css change size of svg or modify svg using js or ever use svgs every time scroll event triggered.

google maps has event in it's api triggered when zoom level changes. https://developers.google.com/maps/documentation/javascript/events#eventproperties


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -