This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.layers.raster; | |
import java.util.Map; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import com.nutiteq.components.Components; | |
import com.nutiteq.components.MapTile; | |
import com.nutiteq.log.Log; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onMapClicked(double x, double y, boolean longClick) { | |
// your activity should have getter for the MapView | |
MapView map = ((TesterMap3DActivity) mapActivity).getMapView(); | |
float zoom = map.getZoom(); | |
double worldSize = 360.0; // for EPSG3857: Math.PI * 6378137.0f * 2.0f; | |
double tileSizeHalf = worldSize / Math.pow(2,zoom) / 2.0; | |
double wgsX = (new EPSG3857()).toWgs84(x, y).x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Layer which reads text,x,y from SQLite database and shows labels in given coordinates. x and y must be in layer projection, | |
which means EPSG:3857 (spherical mercator), or you can use projection.fromWgs() of to convert it. | |
Note that with layer definition you give database file name and SQL which must return x, y and text - in this order, | |
also filter arguments must be in same number and order (xmin,xmax,ymin,ymax). Do not use this for big datasets, as this query | |
is not indexed properly and will become slow with thousands of rows. Use Spatialite for big datasets, as it can do spatial indexes | |
and fast reading from tables with millions of items (e.g. global geonames.org database dump). | |
Usage sample reading from a table "NamesTable" with columns mappos_x,mappos_y,name : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.tasks; | |
import java.io.BufferedInputStream; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.util.Map; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.ui; | |
import henson.midp.Float11; | |
import com.nutiteq.wrappers.Font; | |
import com.nutiteq.wrappers.Graphics; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.app.layers; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.StringReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.util.LinkedList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.rasterlayers; | |
/** | |
* A raster layer class that uses an URL as a source for the map tile data. The request are generate in this manner: | |
* <p> | |
* <p> | |
* baseUrl + zoom + separator + x + separator + y + format | |
* <p> | |
* <p> | |
* For example if: baseUrl = "http://tile.openstreetmap.org/", separator = "/", format = ".png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.app.layers; | |
import com.nutiteq.components.MapPos; | |
import com.vividsolutions.jts.geom.Envelope; | |
public class TileUtils { | |
private static final double TILESIZE = 256; | |
private static final double initialResolution = 2.0f * Math.PI * 6378137.0f | |
/ TILESIZE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.app.listeners; | |
import javax.microedition.khronos.opengles.GL10; | |
import org.json.JSONObject; | |
import android.app.Activity; | |
import android.view.View; | |
import android.webkit.WebView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nutiteq.app.layers; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.URL; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.locks.ReentrantLock; | |
import org.json.JSONArray; |