From 08c20daef238aef14dfab6ea8f7f6f6787bf9405 Mon Sep 17 00:00:00 2001 From: Emux Date: Fri, 26 Jan 2018 15:30:30 +0200 Subject: [PATCH] MapUrl: fix parameters --- vtm-web/src/org/oscim/gdx/client/MapUrl.java | 29 +++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/vtm-web/src/org/oscim/gdx/client/MapUrl.java b/vtm-web/src/org/oscim/gdx/client/MapUrl.java index 6c9ce2fa..d0099b8c 100644 --- a/vtm-web/src/org/oscim/gdx/client/MapUrl.java +++ b/vtm-web/src/org/oscim/gdx/client/MapUrl.java @@ -1,3 +1,20 @@ +/* + * Copyright 2013 Hannes Janetzek + * Copyright 2018 devemux86 + * + * This file is part of the OpenScienceMap project (http://www.opensciencemap.org). + * + * This program is free software: you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with + * this program. If not, see . + */ package org.oscim.gdx.client; import com.google.gwt.user.client.Timer; @@ -90,19 +107,17 @@ public class MapUrl extends Timer { @Override public void run() { mMap.viewport().getMapPosition(pos); - int lat = (int) (MercatorProjection.toLatitude(pos.y) * 1000); - int lon = (int) (MercatorProjection.toLongitude(pos.x) * 1000); + int lat = (int) (pos.getLatitude() * 1000); + int lon = (int) (pos.getLongitude() * 1000); + int tilt = (int) (pos.tilt); int rot = (int) (pos.bearing); - rot = (int) (pos.bearing) % 360; - //rot = rot < 0 ? -rot : rot; if (curZoom != pos.zoomLevel || curLat != lat || curLon != lon - || curTilt != rot || curRot != (int) (pos.bearing)) { - + || curTilt != tilt || curRot != rot) { curLat = lat; curLon = lon; curZoom = pos.zoomLevel; - curTilt = (int) pos.tilt; + curTilt = tilt; curRot = rot; String newURL = Window.Location