HELLO EVERYONE!
I am trying to combine two of the tutorials on gotoAndLearn. The Google-maps and the Search-twitter one. If your not familiar with thoose topics, dont worry, just help me
I am trying do create a RIA, which shows a google-map with pin-points defined in a php-file, onClick i want to be able to show either information DIRECTLY from the twitter RSS or *for example from the wordress API/RSS
*. This information will be shown directly at the pinpoint (like a tooltip).
I’m a rookie on AS3 and I work in Flex Builder 3.
<?xml version=“1.0” encoding=“utf-8”?>
<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml” layout=“absolute”
xmlns:maps=“com.google.maps.*”>
<mx:Script>
<![CDATA[
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.overlays.Marker;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.ZoomControl;
import com.google.maps.MapType;
import com.google.maps.LatLng;
import com.google.maps.MapEvent;
import org.swxformat.*;
[Embed(source="AK47.png")]
private var ak:Class;
private function onReady(e:MapEvent):void
{
map.setCenter(new LatLng(59.33023333333333, 18.0592), 14, MapType.PHYSICAL_MAP_TYPE);
map.addControl(new ZoomControl());
map.addControl(new MapTypeControl());
service.send();
theService.send();
}
private function onResult(e:ResultEvent):void
{
var list:ArrayCollection = e.result.map.loc;
for(var i:int=0; i<list.length; i++)
{
var bm:Bitmap = new ak() as Bitmap;
var m:Marker = new Marker(new LatLng(list*.lat, list*.lon),
new MarkerOptions({**tooltip:list*.name**,
icon:bm,
iconOffset:new Point(-59, -31)}));
map.addOverlay(m);
}
}
]]>
</mx:Script>
<mx:HTTPService id="theService" url="http://twitter.com/statuses/user_timeline/8035032.rss" />
<mx:List dataProvider="{**theService.lastResult.rss.channel.item[0]**}" labelField="title" top="40" left="10"
right="10" bottom="100" id="theList"></mx:List>
<mx:HTTPService id="service" url="map.php" result="onResult(event)"/>
<maps:Map width="100%" height="100%" id="map" mapevent_mapready="onReady(event)"
key="ABQIAAAAygn08KtrPHRID57cCzRochT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQgujvgsY9T-1xHRx_tQQgNFe2vEA"/>
</mx:Application>
I have highlighted the two data-lines i want to swap, if someone could help me with this, I think i could finish the rest!
Thanks!