Adde mapilary layer

This commit is contained in:
Alexey Kulish 2017-04-28 19:34:31 +03:00
parent 7f717db184
commit cdba23274d
5 changed files with 23 additions and 29 deletions

View file

@ -24,7 +24,6 @@ import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.osmo.OsMoPlugin;
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
import net.osmand.plus.skimapsplugin.SkiMapsPlugin;
@ -56,10 +55,6 @@ public abstract class OsmandPlugin {
public abstract int getAssetResourceName();
public boolean isStationary() {
return false;
}
@DrawableRes
public int getLogoResourceId() {
return R.drawable.ic_extension_dark;
@ -83,7 +78,7 @@ public abstract class OsmandPlugin {
}
public boolean isActive() {
return active || isStationary();
return active;
}
public boolean needsInstallation() {
@ -284,16 +279,6 @@ public abstract class OsmandPlugin {
return allPlugins;
}
public static List<OsmandPlugin> getAdjustablePlugins() {
List<OsmandPlugin> res = new ArrayList<>();
for (OsmandPlugin plugin : allPlugins) {
if (!plugin.isStationary()) {
res.add(plugin);
}
}
return res;
}
public static List<OsmandPlugin> getEnabledPlugins() {
ArrayList<OsmandPlugin> lst = new ArrayList<OsmandPlugin>(allPlugins.size());
for (OsmandPlugin p : allPlugins) {

View file

@ -30,6 +30,7 @@ import net.osmand.plus.api.SettingsAPI;
import net.osmand.plus.api.SettingsAPI.SettingsEditor;
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.mapillary.MapillaryPlugin;
import net.osmand.plus.render.RendererRegistry;
import net.osmand.plus.routing.RouteProvider.RouteService;
import net.osmand.render.RenderingRulesStorage;
@ -604,7 +605,7 @@ public class OsmandSettings {
///////////// PREFERENCES classes ////////////////
// this value string is synchronized with settings_pref.xml preference name
private final OsmandPreference<String> PLUGINS = new StringPreference("enabled_plugins", "").makeGlobal();
private final OsmandPreference<String> PLUGINS = new StringPreference("enabled_plugins", MapillaryPlugin.ID).makeGlobal();
public Set<String> getEnabledPlugins() {
String plugs = PLUGINS.get();

View file

@ -76,7 +76,7 @@ public class PluginsActivity extends OsmandListActivity {
protected class PluginsListAdapter extends ArrayAdapter<OsmandPlugin> {
public PluginsListAdapter() {
super(PluginsActivity.this, R.layout.plugins_list_item,
OsmandPlugin.getAdjustablePlugins());
OsmandPlugin.getAvailablePlugins());
}
@Override

View file

@ -1,8 +1,21 @@
package net.osmand.plus.mapillary;
/**
* Created by admin on 27/04/2017.
*/
import android.graphics.Canvas;
public class MApillaryLayer {
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.views.MapTileLayer;
import net.osmand.plus.views.OsmandMapLayer;
import net.osmand.plus.views.OsmandMapTileView;
public class MapillaryLayer extends MapTileLayer {
public MapillaryLayer() {
super(false);
}
@Override
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings drawSettings) {
super.onPrepareBufferImage(canvas, tileBox, drawSettings);
// todo add
}
}

View file

@ -22,7 +22,7 @@ public class MapillaryPlugin extends OsmandPlugin {
private OsmandSettings settings;
private OsmandApplication app;
private MapTileLayer rasterLayer;
private MapillaryLayer rasterLayer;
public MapillaryPlugin(OsmandApplication app) {
this.app = app;
@ -54,18 +54,13 @@ public class MapillaryPlugin extends OsmandPlugin {
return app.getString(R.string.mapillary);
}
@Override
public boolean isStationary() {
return true;
}
@Override
public void registerLayers(MapActivity activity) {
createLayers();
}
private void createLayers() {
rasterLayer = new MapTileLayer(false);
rasterLayer = new MapillaryLayer();
}
@Override