Search in sources :

Example 1 with PolygonMapObject

use of com.yandex.mapkit.map.PolygonMapObject in project react-native-yamap by volga-volga.

the class YamapView method addFeature.

// children
public void addFeature(View child, int index) {
    if (child instanceof YamapPolygon) {
        YamapPolygon _child = (YamapPolygon) child;
        PolygonMapObject obj = getMap().getMapObjects().addPolygon(_child.polygon);
        _child.setMapObject(obj);
        childs.add(_child);
    } else if (child instanceof YamapPolyline) {
        YamapPolyline _child = (YamapPolyline) child;
        PolylineMapObject obj = getMap().getMapObjects().addPolyline(_child.polyline);
        _child.setMapObject(obj);
        childs.add(_child);
    } else if (child instanceof YamapMarker) {
        YamapMarker _child = (YamapMarker) child;
        PlacemarkMapObject obj = getMap().getMapObjects().addPlacemark(_child.point);
        _child.setMapObject(obj);
        childs.add(_child);
    } else if (child instanceof YamapCircle) {
        YamapCircle _child = (YamapCircle) child;
        CircleMapObject obj = getMap().getMapObjects().addCircle(_child.circle, 0, 0.f, 0);
        _child.setMapObject(obj);
        childs.add(_child);
    }
}
Also used : PolygonMapObject(com.yandex.mapkit.map.PolygonMapObject) CircleMapObject(com.yandex.mapkit.map.CircleMapObject) PolylineMapObject(com.yandex.mapkit.map.PolylineMapObject) PlacemarkMapObject(com.yandex.mapkit.map.PlacemarkMapObject)

Aggregations

CircleMapObject (com.yandex.mapkit.map.CircleMapObject)1 PlacemarkMapObject (com.yandex.mapkit.map.PlacemarkMapObject)1 PolygonMapObject (com.yandex.mapkit.map.PolygonMapObject)1 PolylineMapObject (com.yandex.mapkit.map.PolylineMapObject)1