Saturday, January 15, 2011

Something about Guidebee Map API before first application


Guidebee Map API support most of platforms available on the market, different tools and different programming languages may be used for different platform. Guidebee Map API mainly provides Java and C# to support all platforms. The following examples use Java language, but the concepts apply for C# (.Net Framework) also. You can also check platform related examples for reference.
A valid developer license is needed for Guidebee Map API to work properly. The license can be a trial license or a commercial license. The trial license is free and you download it with sample code. But if you need to publish your application you need a commercial license.
The major difference between the two licenses, you get a “Guidebee” watermark on the map for the trial license and some functions may be disabled. From version 2.1, the trial time limitation is lifted. You can use the license as long as you want before you decide to get the commercial licenses.
You need to pay the license fee for the commercial license. For more information, please visit our website at http://www.guidebee.biz or send email to James.shen@guidebee.biz
Guidebee Map API internally supports Google Map Service, CloudMade Map Service and MapAbc Map Service. These map service provider have their own end user agreement. You may need to apply appropriate map key to use their map service legally or you want to use their enhanced map service.
Class MapKey and MapKeyRespository in Guidebee Map API are used to manage these map keys. Guidebee Map API choose proper map key for you to use their map services. But for development purpose, you can use the build-in map keys to run and testing your application.
The code below shows how you add a Google map key to the map key repository.

MapKeyRepository.addMapKey(MapKey.MAPKEY_TYPE_GOOGLE,yourgoogleKey);

There’s some configuration may affect the performance and return result of some map services. Most map configuration is set via MapConfiguation or SearchOptions class.
Here lists some most often used map configurations.
You can configure the maximum number of worker thread used when download map tiles from map server.  The default worker thread number is 4.
You may want to set the number of work thread to 16. Here’s how:

MapConfiguration.setParameter(MapConfiguration.WORKER_THREAD_NUMBER, 16);
With cache turned on, Guidebee Map API stores recently downloaded map tile in the cache to boost map display performance. Of course, cache requires extra memory. The default cache size is 256k.  In some cases you may want to change the cache size or turn off the cache. MapConfiguration. MAP_CACHE_SIZE_IN_BYTES is used to set the cache size. And MapConfiguration. IS_CACHE_ON is used to turn on/off cache.
Search options are mainly used with map service, for instance, when you query an address, you may want to narrow down the return result to 10 or you want to change the return description to Chinese. SearchOptions is the class you can make such settings.
For instance, you can change the language to traditional Chinese using following

DigitalMapService.getSearchOptions().LanguageID="zh-tw";

The default language is English: en-US.

No comments:

Post a Comment