We rolled out a new and better SDK for you.
Allow your users to draw shapes like circles, polygons, and polylines on your map to mark different areas on the map.
Sample use case: You are developing an app for a delivery company and need to illustrate ranges of the transportation area around different cities. What you need to do, for example, is to render circles around cities with radiuses indicating zones of deliveries. The details on the example implementation of shapes rendering are described below.
A TTMapView supports several shape overlays. These are:
Shape overlays are immutable i.e., once they have been created, their shapes cannot be changed ( although you may change their visibility and color). If you want to change a shape, you must remove the existing shape and replace it with a new one.
It is the responsibility of the framework user to be conscientious about performance and how many shape overlays they are using. You should use as few shapes as possible, and hide or dispose of ones that are not being displayed. See the following code examples.
You can implement an observable of shape-clicked event. You can do that with the global delegate TTAnnotationDelegate for all shapes that have to be registered on TTAnnotationManager as in the following examples:
Maps SDK allows to observe a shape-selected event. There is one global delegate TTAnnotationDelegate for all shapes that has to be registered on TTAnnotationManager as follows.