finalize 0.3
git-svn-id: https://osmand.googlecode.com/svn/trunk@390 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
dc2312ad57
commit
c48e4a786f
3 changed files with 61 additions and 8 deletions
|
@ -39,12 +39,6 @@ public class ToDoConstants {
|
||||||
// BUGS Swing
|
// BUGS Swing
|
||||||
|
|
||||||
// DONE ANDROID :
|
// DONE ANDROID :
|
||||||
// 68. Implement service to app work with screen offline
|
|
||||||
// (audio guidance & add new item to status bar & introduce error interval for gps in buildings)
|
|
||||||
// 71. Implement different mechanism for tiles (big sqlite planet see rmaps)
|
|
||||||
// 72. Implement layers menu in map view (select/unselect vector layers to show)
|
|
||||||
// 73. Implement addition POI filter to search online without sd indexes
|
|
||||||
// 74. Implement preview route : show next turn & description (in "show only" route mode) & preview transport route.
|
|
||||||
|
|
||||||
// DONE SWING
|
// DONE SWING
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.osmand.map;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.osmand.osm.MapUtils;
|
||||||
|
|
||||||
|
|
||||||
public class TileSourceManager {
|
public class TileSourceManager {
|
||||||
// transport "http://tile.xn--pnvkarte-m4a.de/tilegen/${z}/${x}/${y}.png", {numZoomLevels: 19,displayInLayerSwitcher:true,buffer:0});
|
// transport "http://tile.xn--pnvkarte-m4a.de/tilegen/${z}/${x}/${y}.png", {numZoomLevels: 19,displayInLayerSwitcher:true,buffer:0});
|
||||||
|
@ -120,6 +122,7 @@ public class TileSourceManager {
|
||||||
list.add(getGoogleMapsSource());
|
list.add(getGoogleMapsSource());
|
||||||
list.add(getGoogleMapsSatelliteSource());
|
list.add(getGoogleMapsSatelliteSource());
|
||||||
list.add(getGoogleMapsTerrainSource());
|
list.add(getGoogleMapsTerrainSource());
|
||||||
|
// list.add(getYandexTrafficSource());
|
||||||
|
|
||||||
list.add(getMicrosoftMapsSource());
|
list.add(getMicrosoftMapsSource());
|
||||||
list.add(getMicrosoftEarthSource());
|
list.add(getMicrosoftEarthSource());
|
||||||
|
@ -178,6 +181,60 @@ public class TileSourceManager {
|
||||||
return new TileSourceTemplate("GoogleMaps Terrain", "http://mt3.google.com/vt/v=w2p.111&hl=en&x={1}&y={2}&z={0}", ".jpg", 15, 0, 256, 32, 18000); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
return new TileSourceTemplate("GoogleMaps Terrain", "http://mt3.google.com/vt/v=w2p.111&hl=en&x={1}&y={2}&z={0}", ".jpg", 15, 0, 256, 32, 18000); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// BufferedInputStream in = new BufferedInputStream(new URL("http://jgo.maps.yandex.net/trf/stat.js").openStream(), 1024);
|
||||||
|
//
|
||||||
|
// ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
|
||||||
|
// BufferedOutputStream out = new BufferedOutputStream(dataStream, 1024);
|
||||||
|
// Algoritms.streamCopy(in, out);
|
||||||
|
// out.flush();
|
||||||
|
//
|
||||||
|
// String str = dataStream.toString();
|
||||||
|
// //JSONObject json = new JSONObject(str.replace("YMaps.TrafficLoader.onLoad(\"stat\",", "").replace("});", "}"));
|
||||||
|
// int start = str.indexOf("timestamp:");
|
||||||
|
// start = str.indexOf("\"", start) + 1;
|
||||||
|
// int end = str.indexOf("\"", start);
|
||||||
|
// String mTimeStamp = str.substring(start, end);
|
||||||
|
// Algoritms.closeStream(in);
|
||||||
|
// Algoritms.closeStream(out);
|
||||||
|
// String r = "http://jgo.maps.yandex.net/tiles?l=trf&x="+((int)tileX) +"&y="+((int)tileY)+"&z=13&ts="+mTimeStamp;
|
||||||
|
// System.out.println(r);
|
||||||
|
// InputStream is = new URL(r).openStream();
|
||||||
|
// dataStream = new ByteArrayOutputStream();
|
||||||
|
// out = new BufferedOutputStream(dataStream, 1024);
|
||||||
|
// Algoritms.streamCopy(is, out);
|
||||||
|
// out.flush();
|
||||||
|
// System.out.println(dataStream.toString());
|
||||||
|
// Algoritms.closeStream(is);
|
||||||
|
// Algoritms.closeStream(out)
|
||||||
|
public static TileSourceTemplate getYandexTrafficSource(){
|
||||||
|
return new TileSourceTemplate("Yandex traffic", "http://jgo.maps.yandex.net/tiles?l=trf&x={1}&y={2}&z={0}&tm=1279836000", ".png", 17, 5, 256, 32, 18000){ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUrlToLoad(int x, int y, int zoom) {
|
||||||
|
double lat = MapUtils.getLatitudeFromTile(zoom, y);
|
||||||
|
final double E2 = (double) lat * Math.PI / 180;
|
||||||
|
final long sradiusa = 6378137;
|
||||||
|
final long sradiusb = 6356752;
|
||||||
|
final double J2 = (double) Math.sqrt(sradiusa * sradiusa
|
||||||
|
- sradiusb * sradiusb)
|
||||||
|
/ sradiusa;
|
||||||
|
final double M2 = (double) Math.log((1 + Math.sin(E2))
|
||||||
|
/ (1 - Math.sin(E2)))
|
||||||
|
/ 2
|
||||||
|
- J2
|
||||||
|
* Math.log((1 + J2 * Math.sin(E2))
|
||||||
|
/ (1 - J2 * Math.sin(E2))) / 2;
|
||||||
|
final double B2 = (double) (1 << zoom);
|
||||||
|
int ny = (int) Math.floor(B2 / 2 - M2 * B2 / 2 / Math.PI);
|
||||||
|
System.out.println(y +" != " + ny);
|
||||||
|
return super.getUrlToLoad(x, ny, zoom);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static TileSourceTemplate getMicrosoftMapsSource(){
|
public static TileSourceTemplate getMicrosoftMapsSource(){
|
||||||
return new MicrosoftTileSourceTemplate("Microsoft Maps", 'r', "png", ".png", 19, 1, 256, 16, 18000); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
return new MicrosoftTileSourceTemplate("Microsoft Maps", 'r', "png", ".png", 19, 1, 256, 16, 18000); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
|
@ -191,6 +248,8 @@ public class TileSourceManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected static final char[] NUM_CHAR = { '0', '1', '2', '3' };
|
protected static final char[] NUM_CHAR = { '0', '1', '2', '3' };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.osmand" android:versionName="0.2.3" android:versionCode="6">
|
package="com.osmand" android:versionName="0.3" android:versionCode="7">
|
||||||
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
||||||
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
|
android:debuggable="false" android:name=".activities.OsmandApplication" android:description="@string/app_description">
|
||||||
<activity android:name=".activities.MainMenuActivity"
|
<activity android:name=".activities.MainMenuActivity"
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
Loading…
Reference in a new issue