Search in sources :

Example 6 with RCTSource

use of com.mapbox.rctmgl.components.styles.sources.RCTSource in project maps by rnmapbox.

the class RCTMGLMapView method removeFeature.

public void removeFeature(int childPosition) {
    AbstractMapFeature feature = features().get(childPosition);
    if (feature == null) {
        return;
    }
    if (feature instanceof RCTSource) {
        RCTSource source = (RCTSource) feature;
        mSources.remove(source.getID());
    } else if (feature instanceof RCTMGLPointAnnotation) {
        RCTMGLPointAnnotation annotation = (RCTMGLPointAnnotation) feature;
        if (annotation.getMapboxID() == mActiveMarkerID) {
            mActiveMarkerID = -1;
        }
        mPointAnnotations.remove(annotation.getID());
    } else if (feature instanceof RCTMGLImages) {
        RCTMGLImages images = (RCTMGLImages) feature;
        mImages.remove(images);
    }
    feature.removeFromMap(this);
    features().remove(feature);
}
Also used : RCTSource(com.mapbox.rctmgl.components.styles.sources.RCTSource) AbstractMapFeature(com.mapbox.rctmgl.components.AbstractMapFeature) RCTMGLImages(com.mapbox.rctmgl.components.images.RCTMGLImages) RCTMGLPointAnnotation(com.mapbox.rctmgl.components.annotation.RCTMGLPointAnnotation)

Example 7 with RCTSource

use of com.mapbox.rctmgl.components.styles.sources.RCTSource in project maps by rnmapbox.

the class RCTMGLMapView method addAllSourcesToMap.

private void addAllSourcesToMap() {
    if (mSources.size() == 0) {
        return;
    }
    for (String key : mSources.keySet()) {
        RCTSource source = mSources.get(key);
        source.addToMap(this);
    }
}
Also used : RCTSource(com.mapbox.rctmgl.components.styles.sources.RCTSource)

Example 8 with RCTSource

use of com.mapbox.rctmgl.components.styles.sources.RCTSource in project maps by rnmapbox.

the class RCTMGLMapView method removeAllSourcesFromMap.

private void removeAllSourcesFromMap() {
    if (mSources.size() == 0) {
        return;
    }
    for (String key : mSources.keySet()) {
        RCTSource source = mSources.get(key);
        source.removeFromMap(this);
    }
}
Also used : RCTSource(com.mapbox.rctmgl.components.styles.sources.RCTSource)

Aggregations

RCTSource (com.mapbox.rctmgl.components.styles.sources.RCTSource)8 AbstractMapFeature (com.mapbox.rctmgl.components.AbstractMapFeature)4 HashMap (java.util.HashMap)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 PointF (android.graphics.PointF)2 Feature (com.mapbox.geojson.Feature)2 ScreenCoordinate (com.mapbox.maps.ScreenCoordinate)2 RCTMGLPointAnnotation (com.mapbox.rctmgl.components.annotation.RCTMGLPointAnnotation)2 RCTMGLImages (com.mapbox.rctmgl.components.images.RCTMGLImages)2 RCTLayer (com.mapbox.rctmgl.components.styles.layers.RCTLayer)2 MapClickEvent (com.mapbox.rctmgl.events.MapClickEvent)2 LinkedList (java.util.LinkedList)2 RectF (android.graphics.RectF)1 ViewGroup (android.view.ViewGroup)1 Layer (com.mapbox.mapboxsdk.style.layers.Layer)1 QueriedFeature (com.mapbox.maps.QueriedFeature)1 QueryFeaturesCallback (com.mapbox.maps.QueryFeaturesCallback)1 RenderedQueryOptions (com.mapbox.maps.RenderedQueryOptions)1 ScreenBox (com.mapbox.maps.ScreenBox)1