Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Google Map Source Code Class

4 replies [Last post]
koharudin
User offline. Last seen 25 weeks 6 days ago. Offline
Joined: 05/28/2009

is there any example using Google Map Tile Server with Nutiteq?

sorry for my poor English...

jaak
User offline. Last seen 13 hours 30 min ago. Offline
Joined: 06/19/2008

Here it one old version just for experimentation, but google may have changed URL-s, so not sure if it works. We do not support it anyway, also it is against Google maps terms of service.

import com.nutiteq.maps.projections.EPSG3785;
import com.nutiteq.ui.Copyright;
import com.nutiteq.ui.StringCopyright;

public class GoogleMap extends EPSG3785 implements GeoMap, UnstreamedMap {

private int mt;

public static final GoogleMap GOOGLE_MAP = new GoogleMap(0);
public static final GoogleMap GOOGLE_SAT = new GoogleMap(1);

// used for conversion
private static final char[] SAT_LETTER = { 'q', 'r', 't', 's' };

public GoogleMap(final int mt) {
this(new StringCopyright("Map data © Google"), mt);
}

public GoogleMap(final Copyright copyright, final int mt) {
super(copyright, 256, 0, 22);
}

public String buildPath(final int x, final int y, final int zoom) {
final int tmpX = x >> 8;
final int tmpY = y >> 8;
final StringBuffer buf = new StringBuffer();
switch (mt) {
case 0:
buf.append("http://mt");
buf.append((tmpX + tmpY) & 3);
buf.append(".google.com/mt?v=nq.83&n=404&x=");
// buf.append((zoom == 0) ? 0 : (tmpX&((1<= 0; i--) {
buf.append(SAT_LETTER[(((tmpY >> i) & 1) << 1) + ((tmpX >> i) & 1)]);
}
break;
}
return buf.toString();
}
}

/JaakL

koharudin
User offline. Last seen 25 weeks 6 days ago. Offline
Joined: 05/28/2009

Thanks jaak, is there any link for nutiteq old version that include that source code. btw, Thanks for your reply...

jaak
User offline. Last seen 13 hours 30 min ago. Offline
Joined: 06/19/2008

The older source is still at http://www.nutiteq.com/libsdk_source.html . As long as I know Google has changed their tile URL format, so it probably does not work with Google.

/JaakL

cristian.streng...
User offline. Last seen 10 weeks 4 days ago. Offline
Joined: 07/18/2008

You can check the gMapMaker source code, it includes up-to-date Google URL formats (although not as java code)... http://www.mgmaps.com/cache