Select to view content in your preferred language

load panoramio images into PictureMarkerSymbol

603
2
08-10-2011 11:07 PM
PaulHastings1
Deactivated User
i'm trying to port functionality from Google maps flex API to arcGIS flex API (not the viewer) that loads panoramio photos within a given map extent. panoramio doesn't have a  "proper" crossdomain policy file, so i gather the photos thru a proxy. works fine.

my problem is creating a PictureMarkerSymbol w/an image. creating one w/the direct URL throws security sandbox errors & in the  google maps approach (via a loader) returns null content.

protected function createPanoramioMarker(panoramioData:Object):Graphic {
var thisGraphic:Graphic=new Graphic();
var imgURL:String=panoramioData.photo_file_url;
var loadThumbnail:Loader=new Loader();   
loadThumbnail.load(new URLRequest(imgURL));
thisGraphic.geometry=WebMercatorUtil.geographicToWebMercator(new
  MapPoint(panoramioData.longitude,panoramioData.latitude));   
thisGraphic.symbol=new PictureMarkerSymbol(loadThumbnail);
thisGraphic.toolTip=panoramioData.photo_title;   
return thisGraphic;
}

appreciate any ideas, even "do it another way".

thanks.
Tags (2)
0 Kudos
2 Replies
ReneRubalcava
Esri Frequent Contributor
The loader itself is not the actual source, the loader will go outside your app and grab your data for you. You'll want to add an event listener to the contentLoaderInfo of the loader so that when the data is returned and ready, then you can use it as a source for the PictureMarkerSymbol.

So something like this
loadThumbnail.contentLoaderInfo.addEventListener(Event.COMPLETE,
 function(e:Event):void {
  thisGraphic.symbol=new PictureMarkerSymbol(e.currentTarget.content);
 });


I haven't tried this approach to load a PictureMarkerSymbol, but I think it would work.
0 Kudos
PaulHastings1
Deactivated User
thanks but still not working. i've even tried simply embedding a graphic & it never shows. wonder if this class is broken? have you ever used this class before? don't see much mention of it.


btw google's marker can handle the loader, seems to know what to do with it.
0 Kudos