Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0804cff706
2 changed files with 23 additions and 6 deletions
|
@ -397,7 +397,6 @@ public class GeoPointParserUtil {
|
||||||
actual = GeoPointParserUtil.parse(url);
|
actual = GeoPointParserUtil.parse(url);
|
||||||
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
|
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
|
||||||
|
|
||||||
// TODO this URL does not work, where is it used?
|
|
||||||
// whatsapp
|
// whatsapp
|
||||||
// https://maps.google.com/maps?q=loc:34.99393,-106.61568 (You)
|
// https://maps.google.com/maps?q=loc:34.99393,-106.61568 (You)
|
||||||
z = GeoParsedPoint.NO_ZOOM;
|
z = GeoParsedPoint.NO_ZOOM;
|
||||||
|
@ -406,6 +405,14 @@ public class GeoPointParserUtil {
|
||||||
actual = GeoPointParserUtil.parse(url);
|
actual = GeoPointParserUtil.parse(url);
|
||||||
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
|
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
|
||||||
|
|
||||||
|
// whatsapp
|
||||||
|
// https://maps.google.com/maps?q=loc:34.99393,-106.61568 (USERNAME)
|
||||||
|
z = GeoParsedPoint.NO_ZOOM;
|
||||||
|
url = "https://maps.google.com/maps?q=loc:" + dlat + "," + dlon + " (USER NAME)";
|
||||||
|
System.out.println("url: " + url);
|
||||||
|
actual = GeoPointParserUtil.parse(url);
|
||||||
|
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
|
||||||
|
|
||||||
// http://www.google.com/maps/search/food/34,-106,14z
|
// http://www.google.com/maps/search/food/34,-106,14z
|
||||||
url = "http://www.google.com/maps/search/food/" + ilat + "," + ilon + "," + z + "z";
|
url = "http://www.google.com/maps/search/food/" + ilat + "," + ilon + "," + z + "z";
|
||||||
System.out.println("url: " + url);
|
System.out.println("url: " + url);
|
||||||
|
@ -947,10 +954,9 @@ public class GeoPointParserUtil {
|
||||||
if(opath.contains(pref)) {
|
if(opath.contains(pref)) {
|
||||||
opath = opath.substring(opath.lastIndexOf(pref) + pref.length());
|
opath = opath.substring(opath.lastIndexOf(pref) + pref.length());
|
||||||
}
|
}
|
||||||
final String postf = " (You)";
|
final String postf = "\\s\\((\\p{IsAlphabetic}|\\s)*\\)$";
|
||||||
if (opath.contains(postf)) {
|
opath = opath.replaceAll(postf, "");
|
||||||
opath = opath.substring(0, opath.indexOf(postf));
|
System.out.println("opath=" + opath);
|
||||||
}
|
|
||||||
return parseGoogleMapsPath(opath, params);
|
return parseGoogleMapsPath(opath, params);
|
||||||
}
|
}
|
||||||
if (fragment != null) {
|
if (fragment != null) {
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.osmand.PlatformUtil;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.data.Amenity;
|
import net.osmand.data.Amenity;
|
||||||
import net.osmand.osm.PoiType;
|
import net.osmand.osm.PoiType;
|
||||||
|
import net.osmand.osm.edit.Node;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
import net.osmand.plus.ContextMenuAdapter;
|
||||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
@ -161,7 +162,15 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
new EditPoiDialogFragment.ShowDeleteDialogAsyncTask(mapActivity)
|
new EditPoiDialogFragment.ShowDeleteDialogAsyncTask(mapActivity)
|
||||||
.execute((Amenity) selectedObj);
|
.execute((Amenity) selectedObj);
|
||||||
} else if (resId == R.string.poi_context_menu_modify) {
|
} else if (resId == R.string.poi_context_menu_modify) {
|
||||||
|
if (selectedObj instanceof Amenity) {
|
||||||
EditPoiDialogFragment.showEditInstance((Amenity) selectedObj, mapActivity);
|
EditPoiDialogFragment.showEditInstance((Amenity) selectedObj, mapActivity);
|
||||||
|
} else if (selectedObj instanceof OpenstreetmapPoint) {
|
||||||
|
final Node entity = ((OpenstreetmapPoint) selectedObj).getEntity();
|
||||||
|
EditPoiDialogFragment.createInstance(entity, false)
|
||||||
|
.show(mapActivity.getSupportFragmentManager(), "edit_poi");
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Selected object is not editable");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -171,6 +180,8 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
Amenity amenity = (Amenity) selectedObj;
|
Amenity amenity = (Amenity) selectedObj;
|
||||||
final PoiType poiType = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
|
final PoiType poiType = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
|
||||||
isEditable = !amenity.getType().isWiki() && !poiType.isNotEditableOsm();
|
isEditable = !amenity.getType().isWiki() && !poiType.isNotEditableOsm();
|
||||||
|
} else if (selectedObj instanceof OpenstreetmapPoint) {
|
||||||
|
isEditable = true;
|
||||||
}
|
}
|
||||||
if (isEditable) {
|
if (isEditable) {
|
||||||
adapter.item(R.string.poi_context_menu_modify).iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg();
|
adapter.item(R.string.poi_context_menu_modify).iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg();
|
||||||
|
|
Loading…
Reference in a new issue