Google has added another API for using Google Maps, the Action Script Flash API.
While Google aimed the interface for Flex, this little demo is about using it in Haxe
as well.
There were some small problems which needed to be resolved,
but here is the first sample:
Demo for Google Maps with Haxe. Please activate Javascript
Usage: You could use the left mouse button to insert draggable markers.
Zoom-Control and map styles should work
as known by Google Maps.
It is amazing how simple the API is and how easy it could be integrated into your code.
Here is the extract for setting a center,
the zoom level and adding three controls:
setCenter(new LatLng(53.559889,10.038757), 14, MapType.NORMAL_MAP_TYPE); setZoom(10,false); addControl(new ZoomControl()); addControl(new PositionControl()); addControl(new MapTypeControl());
And this is the code for the event handler:
private function onMapClick(event:MapMouseEvent) {
addOverlay(new Marker(event.latLng,
new MarkerOptions({draggable: true})));
}
The whole sample will be integrated into the Haxe Flash tutorial in an upcomming chapter.
Haxe | Adobe | Ratgeber Gesundheit
(C) 2008 S. Gorr. All rights reserved