Random header image at labs.ghostinteractive.net

More Overlay Example Code Available

April 17th, 2009  |  Published in ActionScript  |  by Jeremy  |  9 Comments

A couple of new overlay code examples have been added to our Google Code repository. These examples are very stripped down versions of the more detailed demos originally released. They can be compiled directly from Flash CS3 or CS4.

Click the blue hotspots to pan and zoom:





Dowload Here: overlays_basics_CS3_2009_04_15.zip

Responses

  1. Hyder Alamgir says:

    April 21st, 2009at 1:13 am(#)

    Great overlays! But I’d like to use in my OpenStreetMap project, how soon can you get projection calculations done to get that implemented.

    Ideally, I’d like to it be able parse latlng values directly.

    I know Google uses the Mercator Projection, you can find some Math on it at Wikipedia:

    http://en.wikipedia.org/wiki/Mercator_projection

  2. Ghost Interactive says:

    April 21st, 2009at 1:27 am(#)

    The overlay extension is made to work with the OpenZoom MultiScaleImage only. Integration with actual mapping software is not the core focus. There is some cool software out there though that allows you to place custom overlays in latlng coordinates. Have you checked out ModestMaps or UMap.
    Here are a couple of links that might point you in the right direction.
    http://modestmaps.com/
    http://www.afcomponents.com/components/umap_as3/

    Thanks for your interest!
    ~Jeremy

  3. Hyder Alamgir says:

    May 18th, 2009at 8:42 pm(#)

    For anyone interested, here’s the code to convert lat,lng to x,y coordinates on the openzoom map.

    sinLat = Math.sin(latitude * Math.PI / 180 );
    pixelX = (longitude + 180 ) / 360;
    pixelY = ( .5 – Math.log(( 1 + sinLat ) / ( 1 – sinLat )) / ( 4 * Math.PI ));

    Tried and tested on openstreetmap api, but haven’t used your overlay component yet, was using Daniel’s openzoom markers.

  4. Hyder Alamgir says:

    May 18th, 2009at 8:46 pm(#)

    Oh and don’t forget

    marker.x = pixelX * map.sceneWidth;
    marker.y = pixelY * map.sceneHeight;

  5. Randy says:

    July 27th, 2009at 10:02 pm(#)

    This is really great stuff. Can I compile these code examples in Flex using an actionscript project (i understand that would probably have to convert any linked movieclips for use in)? Or do you have an example of using overlays with the openzoom flex MultiscaleImage component?

  6. Jeremy says:

    July 28th, 2009at 12:55 am(#)

    Hi Randy,

    In order to use the the overlay extension within a Flex project you would most likely need to modify the overlay classes to extend UIComponent. I have yet to try this myself only because I haven’t had the need for OpenZoom + Flex. If you find yourself doing so, let me know and maybe we can add it to the code-base!

    There is a download available from the google code project site that doesn’t require the Flash IDE ( all graphics are embedded ). So, If you are looking to compile a pure ActionScript 3.0 version be sure to check that out too.

    Thanks,
    ~Jeremy

  7. Randy says:

    July 29th, 2009at 7:50 pm(#)

    Thanks for the response, Jeremy. I will try modifying the overlay classes and let you know if I have any success.

  8. Randy says:

    July 29th, 2009at 8:46 pm(#)

    I got the pure AS3 example to compile in Flex as an AS3 project; however, flex wouldn’t allow the Hotspots class to access the DEFAULT_SCENE_DIMENSION var of the IMultiScaleContainer (it’s a protected constant). I just replaced it with the constant value provided in the IMultiScaleContainer class and it ran ok. I’m just not sure why the example compiles ok in Flash CS3 with that error. I am still going to try extending these classes so they compile within a Flex project, maybe as a component.

    Thanks again,
    Randy

  9. Jeremy says:

    July 30th, 2009at 4:42 am(#)

    @Randy

    Cool, glad to hear you got the examples working!

Leave a Response

About labs.ghostinteractive.net

This site is currently inactive. Support for the Overlay Extension for OpenZoom will be provided. Feel free to leave questions or comments and I'll try to get back to you prompty . Subscribe via RSS »