A google maps API for Codename One.
Most of the maps/maps related API can be called via url (rest based)
and they returns JSON/XML.
Parsing the returned data can be an herculean task though. This is
where coma excels.
coma parses the returned data and return to you java objects. For
instance the below json
"bounds" : {
"northeast" : {
"lat" : 45.5101458,
"lng" : -73.55252489999999
},
"southwest" : {
"lat" : 43.6533103,
"lng" : -79.38373319999999
}
}
will return an object bounds that contains two objects northEast and
southWest. Each of northEast and southWest will also contain a lat
and lng double variables.
You can use the API like this -
Coma coma = new Coma();
Result result = Result.fromContent(is, Result.JSON);
Geocode geocode = new Geocode(coma);
GoogleGeocodeResult geocodeResult =
geocode.parseGeoCodeResult(result);
List<SingleResult> results = geocodeResult.getResults();
Result result = Result.fromContent(is, Result.JSON);
Direction direction = new Direction(new Coma());
GoogleDirectionResult directionResult =
direction.parseDirectionsResult(result);
List<SingleRoute> routes = directionResult.getRoutes();
The project is hosted on github -
https://github.com/segun/coma
Hi Shai/Chen
If I compile this into a jar file, how do I use it in a CN1 project?
Thanks.
--
Akintayo A. Olusegun
Chief Executive Hustler
Idempotent Systems.
Skype: akintayo.segun
Gmail: akintayo.segun
Phone: 234-706-202-2486
-------------------------------------------------------------------------------------------------------
Akintayo Abiona Olusegun
pǝʇɐʇs ǝsıʍɹǝɥʇo ssǝlun unƃǝsnlo ɐuoıqɐ oʎɐʇuıʞɐ
Si crees que puedes, tienes razón. Si crees que no puedes tienes
razón.