p-lr / MapView

A Fast, memory efficient Android library to display tiled maps, with support for markers, paths, and rotation.
Apache License 2.0
184 stars 38 forks source link

Draw polygon #31

Closed shunplus closed 2 years ago

shunplus commented 2 years ago

I want to draw a polygonal area, how should I use it?

p-lr commented 2 years ago

You can achieve this by adding a custom view which is registered as a ReferentialListerner. See the doc here. If your polygon area needs to scale when the user zoom, you can set the scale of the canvas using the scale of the ReferentialOwner (your custom view). Using a custom view, you can draw anything you want on the MapView, and position/scale/rotate it accordingly.