use of net.osmand.plus.views.AidlMapLayer in project Osmand by osmandapp.
the class OsmandAidlApi method registerAddMapLayerReceiver.
private void registerAddMapLayerReceiver(final MapActivity mapActivity) {
addMapLayerReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String layerId = intent.getStringExtra(AIDL_OBJECT_ID);
if (layerId != null) {
AMapLayer layer = layers.get(layerId);
if (layer != null) {
OsmandMapLayer mapLayer = mapLayers.get(layerId);
if (mapLayer != null) {
mapActivity.getMapView().removeLayer(mapLayer);
}
mapLayer = new AidlMapLayer(mapActivity, layer);
mapActivity.getMapView().addLayer(mapLayer, layer.getZOrder());
mapLayers.put(layerId, mapLayer);
}
}
}
};
mapActivity.registerReceiver(addMapLayerReceiver, new IntentFilter(AIDL_ADD_MAP_LAYER));
}
use of net.osmand.plus.views.AidlMapLayer in project Osmand by osmandapp.
the class OsmandAidlApi method registerMapLayers.
public void registerMapLayers(MapActivity mapActivity) {
for (AMapLayer layer : layers.values()) {
OsmandMapLayer mapLayer = mapLayers.get(layer.getId());
if (mapLayer != null) {
mapActivity.getMapView().removeLayer(mapLayer);
}
mapLayer = new AidlMapLayer(mapActivity, layer);
mapActivity.getMapView().addLayer(mapLayer, layer.getZOrder());
mapLayers.put(layer.getId(), mapLayer);
}
}
Aggregations