Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
Examples for Maps API for Java ME
Nokia Asha Platform 1.0
Series 40 DP 2.0
Series 40 DP 1.1
General information for the HERE Maps API for Java ME can be found from the HERE Maps API for Java ME site.
Similar examples for other technologies can be found from:
- Qt Maps Examples
- QtQuick Maps Examples
- Maps Examples for Windows phone
There are at least two different ways on implementing the Map canvas with the HERE Maps API for Java ME. One way would be to simply using the MapCanvas as directly a member variable as illustrated in helloMap.zip example, and other ways would include deriving new class from the MapCanvas and then using that new class JavaME_HelloMap2.zip when instantiating the Map. Basically both ways are working just as good, the selected way would depends on which way additional logic is going to be later on added to the application.
By default map is shown using English language texts in it, Setting the Map language in the Maps API for Java ME article shows how you could also utilize other languages.
The creating a custom Map Item with Maps API for Java ME article shows examples on how you can construct a CustomItem for Map view and how to use that CustomItem in a Form.
The Map event handling with HERE Maps API for Java ME is implemented very differently when compared to other Map APIs, basically there are only two real Map events generated, and they are implemented by MapListener interface. This interface defined two function mapContentUpdated() which is simply called for any change in Map, and mapUpdateError() which is called in case of error with maps updating. Additionally you can get pointer & key events by implementing a custom MapComponent and adding it to the Map, as explained in: Handling map events with Maps API for Java ME article.
There is also concise articles on using Map events for implementing kinetic panning in Implementing Kinetic panning with Maps API for Java ME article as well as how to use the map events for implementing Pinch zooming Implementing Pinch zooming with Maps API for Java ME article.
Map markers adding removal and operations such as making Markers draggable are illustrated in Adding Markers to the Map with Maps API for Java ME article.
And How to create a marker tooltip with Maps API for Java ME article then shows on how you could show tooltip with markers.
Coding for handling Polylines, Polygons, Circles and Rectangles with Maps is shown in Content Handling with Maps API for Java ME article
Similarly as with other Maps APIs with the Maps API for Java ME you can show different map types, How to Create a Custom Map View article shows on how you can switch between normal, hybrid and other map types.
Geo coding with Maps API for Java ME is explained in details with Geocoding an address with Geocoding an address with Maps API for Java ME article. Another example for geocoding can be found from How to display an Address or a Point of Interest on a Map with Java ME article.
Reverse Geo coding with Maps API for Java ME is explained in details with Reverse Geocoding an address from Geo-location with Maps API for Java ME article.
Different Search service options are explained in details in Search with Maps API for Java ME article.
the How to calculate and show a route with Maps API for Java ME article illustrates on how to use the routing service with Maps API for Java ME.
And Advanced Routing with Java ME show more advanced routing options.
The location of the user with Maps API for Java ME can be gotten by using PositioningManager. Using a JSR-179 Location Provider and displaying the result on a Map article shows on how this API can be used.
In case interaction is not really needed for the map application, or if you need to get static map image, then instead of using the Java ME Map API, you could utilize the Map Image API instead, ready made example for utilizing this API with Java is available at: Using the RESTful Map API with Java ME article.
Custom map provider
The Implementing a custom MapUrlProvider overlay with Maps API for Java ME article shows on how you can implement a custom MapUrlProvider and how to add it as overlay over a map.