Unity

1. Can I use a maps provider other than MapQuest(OSM) with the MapNav Geolocation Toolkit?
Yes, MapNav is compatible with most maps providers, as long as you follow the "center,zoom and size" format to build your map tile request. In order to implement any of them, you will need to edit the corresponding bits of code in the MapNav.cs and MapNavInspector.cs scripts as in the following examples:
Mapnav.cs
MAPQUEST (Default)
//Add possible values to maptype and mapsize arrays (MAPQUEST)
maptype = new string[]{"map", "sat", "hyb"};
mapSize = new int[]{640, 1280, 1920, 2560}; //in pixels
//MAPQUEST ==============================================================================
//Build a valid MapQuest OpenMaps tile request for the current location
multiplier=mapSize[indexSize]/640.0f; //Tile Size= 640*multiplier
url="http://open.mapquestapi.com/staticmap/v4/getmap?key="+key+"&size="+mapSize[indexSize].ToString()+","
+mapSize[indexSize].ToString()+"&zoom="+zoom+"&type="+maptype[indexType]+"&center="+fixLat+","+fixLon+"&scalebar=false";
tempLat = fixLat;
tempLon = fixLon;

GOOGLE MAPS
//Add possible values to maptype and mapsize arrays (GOOGLE)
maptype = new string[]{"satellite","roadmap","hybrid","terrain"};
mapSize = new int[]{640}; //in pixels
//GOOGLE ================================================================================
//Build a valid Google Maps tile request for the current location
multiplier=1;
url= "http://maps.googleapis.com/maps/api/staticmap?center="+fixLat+","+fixLon+"&zoom="+zoom+"
&scale=2&size=640x640&format=jpg&maptype="+maptype[indexType]+"&sensor=false&key="+key;
tempLat = fixLat;
tempLon = fixLon;

BING MAPS
//Add possible values to maptype and mapsize arrays (BING)
maptype = new string[]{"Aerial","AerialWithLabels","Road"};
mapSize = new int[]{834,834}; //in pixels
//BING MAPS ==============================================================================
//Build a valid Microsoft Bing tile request for the current location
multiplier=mapSize[indexSize]/640.0f;
url= "http://dev.virtualearth.net/REST/v1/Imagery/Map/"+maptype[indexType]+"/"+fixLat+"," +fixLon+"/"
+zoom+"?mapSize="+mapSize[indexSize].ToString()+","+mapSize[indexSize].ToString()+"&key="+key;
tempLat = fixLat;
tempLon = fixLon;
MapNavInspector.cs
MAPQUEST (Default)
//MAPQUEST ==============================================================================
private string[] mapTypes = new string[]{"map","sat","hyb"};
private string[] mapSizes = new string[]{"640x640","1280x1280","1920x1920","2560x2560"};

GOOGLE MAPS
//GOOGLE ================================================================================
private string[] mapTypes = new string[]{"satellite","roadmap","hybrid","terrain"};
private string[] mapSizes = new string[]{"640x640"};

BING MAPS
//BING MAPS ==============================================================================
private string[] mapTypes = new string[]{"Aerial","AerialWithLabels","Road"};
private string[] mapSizes = new string[]{"834x834"};
SonicMapsSonicMaps
Powered by MapNav
©2013 Recursive Arts
info[at]recursivearts.com