J2ME Google Maps API is article of the week on Forum Nokia!
I’m really happy to announce that my J2ME Google Maps API article on Forum Nokia Wiki has been selected as Article of the Week!
And, to celebrate this event, I’ve added a brand new feature to my article that will allow you to:
- create larger tiled maps
- support map scrolling
How does it work?
You start instantiating a GoogleMaps object as usual:
GoogleMaps gMap = new GoogleMaps("API_KEY"); |
Then you get your map, for example geocoding a given address:
double[] coords = gMap.geocodeAddress("Leicester square, London"); Image mapImage = gMap.retrieveStaticImage( 150, 150, coords[0], coords[1], 12, "png" ); |
Then, let’s say you want to scroll your map 100 pixels up, what you’ll do is:
double[] newCoords = gMap.adjust( coords[0], coords[1], 0, -100, 12 ); Image newMapImage = gMap.retrieveStaticImage( 150, 150, newCoords[0], newCoords[1], 12, "png" ); |
As you’ve seen, the adjust method takes these arguments:
- the current latitude and longitude
- the deltaX and deltaY, in pixels
- the current zoom level
and returns the new map center latitude and longitude coordinates.
You can check the full updated source code on Forum Nokia Wiki article: J2ME Google Maps API, and a full-featured example, with the scrolling feature, on the emulator page: J2ME Google Maps API in action.
J2ME, Flash Lite, Symbian, Iphone, Android and Ajax news, tutorials, source code » Blog Archive » Google Maps mobile tutorial is Wiki article of the Month! 1:30 pm on June 11, 2008 Permalink
[...] Mobile games development English site Italian site « J2ME Google Maps API is article of the week on Forum Nokia! [...]
HSCharles 4:35 am on November 14, 2008 Permalink
I have a flash website
i’m looking for the script who of google adsense with flash.
can you give me the link?
aditya 2:27 pm on February 16, 2009 Permalink
Is there a zip file which has the .jar , .jad and .java file that i could try on J2Me wireless tool kit. I am a j2me beginner
zibi 5:12 pm on August 13, 2011 Permalink
I am trying to use adjust function for scrolling tiles, and i think that its inaccurate, i cant get two tiles match correctly