Hi Martin,
Background I used AFComponent's free "GMap 2" tool and Adobe Flash. AFC also sell the UMap component that Smooth mentioned in an earlier post. I used GMap because (at that time) it was free (it was a test) and it utilized Google Maps rather than Microsoft Virtual Earth. It also runs on AS2 rather than AS3 (use UMap if AS3 is required). The way the GMap component retrieves the data can be an issue. GMap goes via an intermediate server to pull map tiles from Google. This can choke under large demand. Check to see if it fits your own requirements (and licence requirements). UMap is different so you would need to look into how it retrieves data.
Adobe Flash Download the AFC GMap component and install it in Flash. It comes with a help document and example project. Create two layers: one for code the other for the GMap component. In the GMap layer, drag the GMap component onto the stage. On the code layer you need it create your window and positional requires. I followed the tutorials from their website (quite straight forward if you are familar with Flash). To get the Lat/Lng you'll need to truncate the Google Maps coordinates as they are too long. Get these from Google Maps as mentioned above in the step by step to getting URL.
Example actionscript code (AS2)
gMap.setMapType("satellite"); gMap.setCenter({lat:-41.258997, lng:174.865925},12);
var point = gMap.addPoint({lat:-41.258997, lng:174.865925, name:"Matiu/Somes Island, Wellington", description:"Trig Point(56m)", radius:10, strokeRGB:0x000000, strokeThickness:1, fillRGB:0xFFFF00}); point.show();
var posControl = gMap.addControl(gMap.GPositionControl({visibility:"off"})); posControl.show();
var zoomControl = gMap.addControl(gMap.GZoomControl({display:"expanded"})); zoomControl.align = "top-left";
var typeControl = gMap.addControl(gMap.GTypeControl({visibility:"off"})); typeControl.show();
function eventResponder(evnt){ evnt.target.openInfoWindow({title:evnt.target.name, content:evnt.target.description, contentAutoSize:true, titleRGB:0x000000, contentRGB:0x666666, radius:6, stroke:false, fillRGB:0xFFFF00, fillAlpha:90}); }
// add event listener point.addEventListener("GEOMETRY_ON_RELEASE", eventResponder);
Publish the finished project (or test it) and you should have a swf file ready to use in a pop up window in your TW tour - that easy!
All this info can be found on the AFC website and Forum.
Hope this helps.
|