OSM Static API with JavaFX

OSM(http://www.osm.org) has released their first prototype of static map api. It is aimed to make web mapping easier to refer just like google has done.

All interfaces are listed in following page:
http://dev.openstreetmap.org/~pafciu17/

With OSM static api, you can:

  • Show a map centered at a specified point. (using center, height and width)
  • Show a map contains specified bound box. (using bbox, zoom/height/width)
  • Create point/path/polygon in static map.
  • Choose different map render engines.
  • Control logo position in output image.

I just tested it with a simple javafx applet. For there is no crossdomain.xml on the server of OSM, to get cross-domain images, you will be asked to confirm security. Feel free to change center latitude/longitude and zoom level.


Enjoy all these free data on free applications :)

Steps to create signed javafx applet

  • javafxc OSMStaticMap.fx
  • javafxpackger javafxpackager -src . -appClass OSMStaticMap -appWidth 500 -appHeight 500
  • cd dist
  • keytool -genkey -keystore classicning.keys -alias  http://www.classicning.com/ -validity 365
  • jarsigner –keystore classicning.keys –storepass ******** OSMStaticMap.jar http://www.classicning.com/
This entry was written by Sunng , posted on Saturday July 18 2009at 04:07 pm , filed under 手艺 and tagged , , , , , , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word