문제

I have a function that plots a polygon centered over a certain location. I noticed that when a user zooms, the size of the polygon stays geographically the same, meaning it changes screenwise (i.e. zooming out displays a larger portion of the map, while the polygon occupies a small portion of the map).

One could say that I position the polygon with respect to geographical measurements but I wish to size it with respect to screen ditto.

How can I do that?

I suppose I could find out the size of the viewer or screen and check that against boundaries of the map and so on. However, that sounds like a tedious approach and I trust that there's functionality in the API that does all that for me, likely much faster and more reliably.

도움이 되었습니까?

해결책

Since polygons are tied to locations you will need to just draw an image on the screen instead. (Unless you like to inflict pain upon yourself and recalculate all the polygon locations when the zoom changes).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top