Google map is used by default in the Web tracking bee map service, but you can also choose other map services. For example, when Google is offline, you can choose the map service of MapAbc, note that there is an offset on the map of China. If you want to use a map of China without offset, use the map offset correction algorithm, and use the CloudMade map service.
As mentioned above, the Guide bee map development kit designs map image display and map service in two relatively independent parts: Google China map image and Bing China map image, the MapAbc map of China is a map image with an offset, while the CloudMade (OpenStreet) map of China is a map image without an offset. In the Google China Map Service, the MapAbc China Map Service has an offset while the CloudMade map service does not. Therefore, when selecting the map type and map service type, either an offset or no offset is selected. Otherwise, the map does not match when the path or address is displayed.
The following list is a valid combination:
Map type: DigitalMapService)
GOOGLECHINA GOOGLE_MAP_SERVICE
MICROSOFTCHINA GOOGLE_MAP_SERVICE
MAPABCCHINA GOOGLE_MAP_SERVICE
OPENSTREETMAP CLOUDMADE_MAP_SERVICE
GOOGLECHINA MAPABC_MAP_SERVICE
MICROSOFTCHINA MAPABC_MAP_SERVICE
MAPABCCHINA MAPABC_MAP_SERVICE
The following shows how to query the path when the map type is MICROSOFTCHINA and different map services are used. (Path from Nanjing to Tianjin)
[Java]
// ----------------------------------- PACKAGE ------------------------------------
Package com. pstreets. gisengine. demo. rim;
// ------------------------------------- IMPORTS ------------------------------------
Import com. mapdigit. gis. MapDirection;
Import com. mapdigit. gis. geometry. GeoLatLng;
Import com. mapdigit. gis. raster. MapType;
Import com. mapdigit. gis. service. IRoutingListener;
Import com. mapdigit. gis. service. DigitalMapService;
Import com. pstreets. gisengine. demo. MapDemoRIM;
Import net. rim. device. api. ui. component. Menu;
Import net. rim. device. api. ui. MenuItem;
// [-------------------------------- Main class ----------------------------------]
/**
* Map routing demo for Guidebee Map API on RIM platform.
* <Hr> <B>©Copyright 2011 Guidebee, Inc. All Rights Reserved. </B>
* @ Version 1.00, 10/02/11
* @ Author Guidebee Pty Ltd.
*/
Public class MapServiceTypeRIM extends MapDemoRIM implements
IRoutingListener {
/**
* Entry point for application
* @ Param args Command line arguments (not used)
*/
Public static void main (String [] args)
{
// Create a new instance of the application and make the currently
// Running thread the application's event dispatch thread.
MapServiceTypeRIM theApp = new MapServiceTypeRIM ();
TheApp. enterEventDispatcher ();
}
Private MenuItem mapgetdiremenmenuitem = new MenuItem ("Get Direction", 0, 0 ){
Public void run (){
GeoLatLng latLng1 = new GeoLatLng (32.0418381, 118.7788905 );
GeoLatLng latLng2 = new GeoLatLng (39.11643, 117.180908 );
Map. getDirections (new GeoLatLng [] {latLng1, latLng2 });
}
};
Public MapServiceTypeRIM (){
Init ();
PushScreen (canvas );
// Map. setCurrentMapService (DigitalMapService. GOOGLE_MAP_SERVICE );
// Map. setCurrentMapService (DigitalMapService. MAPABC_MAP_SERVICE );
Map. setCurrentMapService (DigitalMapService. CLOUDMADE_MAP_SERVICE );
Map. setRoutingListener (this );
GeoLatLng center = new GeoLatLng (32.0616667, 118.7777778 );
Map. setCenter (center, 13, MapType. MICROSOFTCHINA );
}
Public void done (String arg0, MapDirection result ){
If (result! = Null ){
Map. setMapDirection (result );
// Map. resize (result. getBound ());
// Map. setZoom (6 );
Map. setZoom (15 );
Map. panTo (result. routes [0]. startGeocode. point );
}
}
Protected void createMenu (Menu menu, int instance ){
Menu. add (mapgetdiremenmenuitem );
}
}
// ----------------------------------- PACKAGE ------------------------------------
Package com. pstreets. gisengine. demo. rim;
// ------------------------------------- IMPORTS ------------------------------------
Import com. mapdigit. gis. MapDirection;
Import com. mapdigit. gis. geometry. GeoLatLng;
Import com. mapdigit. gis. raster. MapType;
Import com. mapdigit. gis. service. IRoutingListener;
Import com. mapdigit. gis. service. DigitalMapService;
Import com. pstreets. gisengine. demo. MapDemoRIM;
Import net. rim. device. api. ui. component. Menu;
Import net. rim. device. api. ui. MenuItem;
// [-------------------------------- Main class ----------------------------------]
/**
* Map routing demo for Guidebee Map API on RIM platform.
* <Hr> <B>©Copyright 2011 Guidebee, Inc. All Rights Reserved. </B>
* @ Version 1.00, 10/02/11
* @ Author Guidebee Pty Ltd.
*/
Public class MapServiceTypeRIM extends MapDemoRIM implements
IRoutingListener {
/**
* Entry point for application
* @ Param args Command line arguments (not used)
*/
Public static void main (String [] args)
{
// Create a new instance of the application and make the currently
// Running thread the application's event dispatch thread.
MapServiceTypeRIM theApp = new MapServiceTypeRIM ();
TheApp. enterEventDispatcher ();
}
Private MenuItem mapgetdiremenmenuitem = new MenuItem ("Get Direction", 0, 0 ){
Public void run (){
GeoLatLng latLng1 = new GeoLatLng (32.0418381, 118.7788905 );
GeoLatLng latLng2 = new GeoLatLng (39.11643, 117.180908 );
Map. getDirections (new GeoLatLng [] {latLng1, latLng2 });
}
};
Public MapServiceTypeRIM (){
Init ();
PushScreen (canvas );
// Map. setCurrentMapService (DigitalMapService. GOOGLE_MAP_SERVICE );
// Map. setCurrentMapService (DigitalMapService. MAPABC_MAP_SERVICE );
Map. setCurrentMapService (DigitalMapService. CLOUDMADE_MAP_SERVICE );
Map. setRoutingListener (this );
GeoLatLng center = new GeoLatLng (32.0616667, 118.7777778 );
Map. setCenter (center, 13, MapType. MICROSOFTCHINA );
}
Public void done (String arg0, MapDirection result ){
If (result! = Null ){
Map. setMapDirection (result );
// Map. resize (result. getBound ());
// Map. setZoom (6 );
Map. setZoom (15 );
Map. panTo (result. routes [0]. startGeocode. point );
}
}
Protected void createMenu (Menu menu, int instance ){
Menu. add (mapgetdiremenmenuitem );
}
}
These are the paths returned by the three map services. The results returned by the Google map service and the MapAbc map service are basically the same. In fact, the map of the Google map service in China comes from MapAbc. The result returned by the CloudMade map seems to have shifted the road. This is because Bing China map is offset, and CloudMade returns no offset. The results returned by the Google map service and the MapAbc map service are also offset, so they are "matched" with the map ".
Author: mapdigit