Geocoding with Papervision3D Update

GeoGlobe
Click image to view demo

A little over a year ago, I wrote an article for Adobe Edge on how to geocode with Papervision3D.

You can check that article out here.

Since then, however, Papervision3D has been making continual updates and the source code in my article no longer works.
This has been an issue for a while, as several people have noted in the comments on my post about the article.
I finally got around to updating it.

This new version works with the following library versions (both are the latest swcs at the time of this writing):

  • Papervision3D 2.1.920
  • Tweener 1.33.74

Here are the list of changes that needed to be made to work with the latest Papervision3D:

  • The 15 degree longitude offset no longer needs to be there. Set the offset to 0.
  • The default viewportHeight on GlobeView changed to match BasicView’s default of 480.
  • The default cameraType value needed to change from “FREECAMERA3D” to “Free”.
  • Added a default camera pitch of -30 to go along with the default yaw of 180.
  • The camera reference is now cameraAsCamera3D.
  • Changed the focus and zoom of the camera to match the new defaults of 10 and 40 respectively.
  • The rotation values and min/max rotation values in onRenderTick needed to be adjusted.
  • The camera needed to be adjusted further back in onRenderTick but not as far down.
  • The mouse values needed to be adjusted in the onMouseDown.

Here are a list of new additions made to the project:

  • GlobeView set to interactive to allow the markers to be selectable.
  • Earth material did not need to be interactive.
  • Added background to GlobeView to fix globe rotation issues introduced when interactive was set to true on the view.
  • Added default markers.
  • New method to add markers by latitude and longitude.
  • Display of selected marker.
  • Added clone and toString methods to event.
  • To fix a small bug, the defaultButton in GeoGlobe.mxml has been moved to the topmost VBox instead of the internal HBox.
  • The license has been changed to MIT.
  • The domain digitalflipbook has been updated to yourpalmark.
  • Updated the code to follow better standards.
  • The html-template now uses swfobject.

I think that about covers all of the changes. I know many people have been asking for the markers to be interactive, so enjoy!

And without further ado, here’s the new source (make sure you grab the latest Papervision3D and Tweener libraries as well):
Download GeoGlobe

About the author

Mark

View all posts

5 Comments

  • Hi, I am hoping to use your code to plot the position of Agents in other countries through an XML file which gives the latitude and longitude of the particular agent. Am i able to parse these values and have markers show up automatically?
    Speaking as a designer, I am not sure where to start, or if this is even possible can you offer any advice?

    kind regards
    Mike

  • Hey Mike,

    Not a problem at all. There is a method in GeoGlobe.mxml called addMarkers.
    You’ll just need to parse the xml that has the latitudes and longitudes and then pass those values into that method.

    Mark

  • Hi

    great work, and thanks for taking the time to update it.

    I noticed your changeView function was commented out, I’m trying to get this to work so the globe spins to a new marker, but it fails for positive longitude.

    10, -10 works

    10, 10 breaks

    any chance you can figure this one out?

  • Hi Mark,

    your 3d globe is the fastest globe on the market, and I study it all.
    Please inform me where to search to do some modification:
    1. to create a continuous spinning of the globe, to set a rotation speed.
    2. to put the selected marker in the middle of the screen when the marker is selected.
    3.to modify the marker with a png icon.

    thank you!

    Mihai

  • Hey Mark,

    first of all, great work.
    i’m trying to get a selected marker on click in front of the camera (acutally just on the y-axis). but for some reason, it works not 100%. sometimes it is just slighty beside the center, and sometimes it just spinns the wrong way arround 🙂

    any idea?

    thanks
    marco


    ...
    protected function rotateGlobeToMarker(marker : DisplayObject3D) : void
    {
    Tweener.removeAllTweens();
    var rotationY : int = marker.rotationY;
    Tweener.addTween(cameraTarget, {rotationX : 0, rotationY : rotationY,
    time : 2, onComplete : autoRotateComplete});
    }
    ...

Leave a Reply

Your email address will not be published. Required fields are marked *