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 »

ESRI Maps

1 reply [Last post]
jaak
User offline. Last seen 12 hours 44 min ago. Offline
Joined: 06/19/2008

One way to add ESRI ArcGIS maps would be following:
1. Create custom map source with their API, create ESRIMap.java

package com.sample.mymaps;

import com.mgmaps.utils.Tools;
import com.nutiteq.components.MapPos;
import com.nutiteq.components.WgsPoint;
import com.nutiteq.maps.GeoMap;
import com.nutiteq.maps.UnstreamedMap;
import com.nutiteq.maps.projections.EPSG4326;
import com.nutiteq.ui.Copyright;
import com.nutiteq.ui.StringCopyright;
import com.nutiteq.utils.Utils;

/**
* Simple ESRI ArcGIS tile server API implementation using EPSG4326 projection */
public class ESRIMap extends EPSG4326 implements GeoMap, UnstreamedMap {
private final String baseurl;

public ESRIMap(final String baseurl, final int minZoom,
final int maxZoom, final String layer, final String format,
final String copyright) {
this(baseurl, minZoom, maxZoom, layer, format, new StringCopyright(
copyright));
}

public ESRIMap(final String baseurl, final int minZoom,
final int maxZoom, final String layer, final String format,
final Copyright copyright) {
super(copyright, 256, minZoom, maxZoom);

final StringBuffer base = new StringBuffer(Utils.prepareForParameters(baseurl));
base.append("LAYERS=").append(Tools.urlEncode(layer));
base.append("&FORMAT=").append(Tools.urlEncode(format));
base.append("&F=image&SIZE=256,256");
base.append("&SRS=4326&BBOX=");
this.baseurl = base.toString();
}

public String buildPath(final int mapX, final int mapY, final int zoom) {
final StringBuffer result = new StringBuffer(baseurl);

final MapPos minPos = new MapPos(mapX, mapY + getTileSize(), zoom);
final MapPos maxPos = new MapPos(mapX + getTileSize(), mapY, zoom);
final WgsPoint minWgs = mapPosToWgs(minPos).toWgsPoint();
final WgsPoint maxWgs = mapPosToWgs(maxPos).toWgsPoint();

result.append(minWgs.getLon()).append(",").append(minWgs.getLat()).append(",");
result.append(maxWgs.getLon()).append(",").append(maxWgs.getLat());

return result.toString();
}
}

2. Set map in your application:

 ESRIMap esri = new ESRIMap("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export", 0, 19, "show:2", "png", "ESRI");
 esri.setWidthHeightRatio(2.0);
 map.setMap(esri);

/JaakL