Monday, February 9, 2009

Ground Overlays On Maps


Found a historic map of Boston collected by David Rumsey, and thought it would be nice to be able to put this map on a current map. As the image needs to be scaled, rotated and translated, I wrote a custom symbol (OverlaySymbol) to enable the scaling, rotation and translation when the map extent changes. So all that is cool, but the problem was coming up with OverlaySymbol properties. So I wrote the OverlayEditor application that enables you to load the image and using a instance of Flex Object Handles, you can stretch, move and rotate the image. Once you are satisfied with the parameters, you can view the source code of a sample application that you can save and compile with a reference to the OverlaySymbol.as code. You can check out the application here. You can load an image of Mount Etna in Sicily. And like usual you can download the source code from here.

13 comments:

Greg said...

Mansour, You never cease to amaze. Thank you.

Henry said...

Very cool, Ive been playing around with importing images with world files into flex, this sheds some light on the subject.

No Name Is Unique said...

Truly outstanding. I'm standing up and clapping loud.

ThunderHead said...

Glad u like it :-)

No Name Is Unique said...

I just noticed that the image used is the same image that is used as a ground overlay in the KML. Do you know of any resources for loading a KML Ground Overlay into an ArcGIS Flex Map? Or a KML with placemarks? Thanks

ThunderHead said...

Kinda funny that u asked - working on KML as we speak - will keep u posted !

Josh Marcus said...

Any updates on KML? I'm about to start working on loading a KML GroundOverlay into an ArcGIS Flex Map ... but is there progress or code you can share?

Peter said...

So I realize this is an old post but it was the closet thing I could find to what I am trying to do. I was wondering if it is possible to overlay images on a map and have them scale and move as the map zooms/pans. Like overlay satellite images of the ground on-top of the current map and have it move with the map? Is that possible in this api because I cant figure it out....

ThunderHead said...

Will try to update the code to latest API

Flex-Mumbler said...

Hey Mansour,

Very help bit of code, am using it to display image overlay of weather data.

However, I'm having a problem in that setting .source = next image to do an animation causes flicker a the old one unloads before the next one is loaded and ready.

I would usually overcome this be using a Loader to download next image and once ready to simply change the content. However, this doesn't work with OverlaySymbol as you actually use a URL on source.

Any ideas?

Cheers

Ian

balistic said...

Mansour,

I downloaded the OverlayEditor zip file and tried to compile it. But it is giving the following syntax errors:


C:\_pelin\programs\flex\OverlayEditor.mxml(65): Error: Attempted access of inaccessible method duplicate through a reference with static type com.esri.ags.geometry:Extent.

previewMap.extent = overlayMap.extent.duplicate();

C:\_pelin\programs\flex\com\esri\overlay\OverlayMap.as(104): col: 17 Error: Attempted access of inaccessible property m_staticLayer through a reference with static type com.esri.overlay:OverlayMap.

m_staticLayer.removeChild(m_objectHandles);
^

C:\_pelin\programs\flex\com\esri\overlay\OverlayMap.as(135): col: 13 Error: Attempted access of inaccessible property m_staticLayer through a reference with static type com.esri.overlay:OverlayMap.

m_staticLayer.addChild(m_objectHandles);
^

I am not sure what I am doing wrong here.

ThunderHead said...

U r not going anything wrong - email me and will send u an updated swc

balistic said...

Where do I e-mail?