Merge pull request #4104 from osmandapp/alex_branch

Fix #3815
This commit is contained in:
Alexey 2017-07-13 15:00:23 +03:00 committed by GitHub
commit 51d904a8ce
3 changed files with 10 additions and 12 deletions

View file

@ -268,19 +268,19 @@ public class GeoPointParserUtil {
// http://openstreetmap.org/#map=11/34/-106 // http://openstreetmap.org/#map=11/34/-106
z = 11; z = 11;
url = "http://openstreetmap.org/#map=" + z + "/" + ilat + "/" + ilon; url = "https://openstreetmap.org/#map=" + z + "/" + ilat + "/" + ilon;
System.out.println("url: " + url); System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url); actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(ilat, ilon, z)); assertGeoPoint(actual, new GeoParsedPoint(ilat, ilon, z));
// http://openstreetmap.org/#map=11/34.99393/-106.61568 // http://openstreetmap.org/#map=11/34.99393/-106.61568
url = "http://openstreetmap.org/#map=" + z + "/" + dlat + "/" + dlon; url = "https://openstreetmap.org/#map=" + z + "/" + dlat + "/" + dlon;
System.out.println("url: " + url); System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url); actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z)); assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
// http://openstreetmap.org/#11/34.99393/-106.61568 // http://openstreetmap.org/#11/34.99393/-106.61568
url = "http://openstreetmap.org/#" + z + "/" + dlat + "/" + dlon; url = "https://openstreetmap.org/#" + z + "/" + dlat + "/" + dlon;
System.out.println("url: " + url); System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url); actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z)); assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
@ -334,19 +334,19 @@ public class GeoPointParserUtil {
// http://openstreetmap.de/zoom=11&lat=34&lon=-106 // http://openstreetmap.de/zoom=11&lat=34&lon=-106
z = 11; z = 11;
url = "http://openstreetmap.de/zoom=" + z + "&lat=" + ilat + "&lon=" + ilon; url = "https://openstreetmap.de/zoom=" + z + "&lat=" + ilat + "&lon=" + ilon;
System.out.println("url: " + url); System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url); actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(ilat, ilon, z)); assertGeoPoint(actual, new GeoParsedPoint(ilat, ilon, z));
// http://openstreetmap.de/zoom=11&lat=34.99393&lon=-106.61568 // http://openstreetmap.de/zoom=11&lat=34.99393&lon=-106.61568
url = "http://openstreetmap.de/zoom=" + z + "&lat=" + dlat + "&lon=" + dlon; url = "https://openstreetmap.de/zoom=" + z + "&lat=" + dlat + "&lon=" + dlon;
System.out.println("url: " + url); System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url); actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z)); assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));
// http://openstreetmap.de/lat=34.99393&lon=-106.61568&zoom=11 // http://openstreetmap.de/lat=34.99393&lon=-106.61568&zoom=11
url = "http://openstreetmap.de/lat=" + dlat + "&lon=" + dlon + "&zoom=" + z; url = "https://openstreetmap.de/lat=" + dlat + "&lon=" + dlon + "&zoom=" + z;
System.out.println("url: " + url); System.out.println("url: " + url);
actual = GeoPointParserUtil.parse(url); actual = GeoPointParserUtil.parse(url);
assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z)); assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z));

View file

@ -30,7 +30,6 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapillary.MapillaryPlugin;
import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.views.POIMapLayer; import net.osmand.plus.views.POIMapLayer;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
@ -483,9 +482,9 @@ public class AmenityMenuBuilder extends MenuBuilder {
(amenity.getId() % 2 == 0 || (amenity.getId() >> 1) < Integer.MAX_VALUE)) { (amenity.getId() % 2 == 0 || (amenity.getId() >> 1) < Integer.MAX_VALUE)) {
String link; String link;
if (amenity.getId() % 2 == 0) { if (amenity.getId() % 2 == 0) {
link = "http://www.openstreetmap.org/node/"; link = "https://www.openstreetmap.org/node/";
} else { } else {
link = "http://www.openstreetmap.org/way/"; link = "https://www.openstreetmap.org/way/";
} }
buildRow(view, R.drawable.ic_action_info_dark, link + (amenity.getId() >> 1), buildRow(view, R.drawable.ic_action_info_dark, link + (amenity.getId() >> 1),
0, false, null, true, 0, true, null); 0, false, null, true, 0, true, null);

View file

@ -8,7 +8,6 @@ import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapillary.MapillaryPlugin;
import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.render.RenderingIcons; import net.osmand.plus.render.RenderingIcons;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
@ -90,9 +89,9 @@ public class RenderedObjectMenuController extends MenuController {
(renderedObject.getId() % 2 == 1 || (renderedObject.getId() >> 7) < Integer.MAX_VALUE)) { (renderedObject.getId() % 2 == 1 || (renderedObject.getId() >> 7) < Integer.MAX_VALUE)) {
String link; String link;
if ((renderedObject.getId() >> 6) % 2 == 1) { if ((renderedObject.getId() >> 6) % 2 == 1) {
link = "http://www.openstreetmap.org/node/"; link = "https://www.openstreetmap.org/node/";
} else { } else {
link = "http://www.openstreetmap.org/way/"; link = "https://www.openstreetmap.org/way/";
} }
addPlainMenuItem(R.drawable.ic_action_info_dark, link + (renderedObject.getId() >> 7), true, true, null); addPlainMenuItem(R.drawable.ic_action_info_dark, link + (renderedObject.getId() >> 7), true, true, null);
} }