Start building a ModestMaps application with ease

We’re proud to introduce you to a small project we’ve developed in the past weeks: MM Construct . MM Construct is a base application for any Flash AS3 project that uses the excellent ModestMaps library. We strive to help you get up and running quickly with your own visualization projects.

Background

For projects that include mapping data geographically it’s an excellent choice to use the ModestMaps library. Modest Maps provides a great setup for displaying dynamic map data using some popular map providers like Yahoo Maps, the BlueMarbel Project or the OpenStreetMap Project. ModestMaps official website describes the thoughts behind ModestMaps as follows:

“Our intent is to provide a minimal, extensible, customizable, and free display library for discriminating designers and developers who want to use interactive maps in their own projects. Modest Maps provides a core set of features in a tight, clean package, with plenty of hooks for additional functionality.”

We use and love the library, but starting a new visualization we found ourselfs writing the same code over and over again. So we thought about creating a basic setup and wrapping it in a simple package for a more elegant way to start with a MM project in AS3. Having a base application let’s you get quickly to a first visual result and you don’t have to rewrite basic functionalities you most of the time need to include in your apps.

Features

  • ModestMaps & Stamen’s Twisted libraries
  • TweenLite library
  • DocumentClass with the initial code to create:
    • TweenMap
    • Method to colorize the map
    • “Waiter” textfield
    • XML loader
    • Keyboard navigation
    • DoubleClick to zoom in
    • Fullscreen mode
  • GUI class
  • Marker class (for overlaying the map with points)
  • Layer class (for overlaying the map with layers)
  • XML with location examples
  • SWFObject publishing setup
  • Fullbrowser publishing setup

Download

The code is hosted on GITHub.com. Please remember when downloading it that it evolved from a personal need, thus some features won’t be relevant for everybody as well as the coding structure might not suit your taste. Feel free to participate in the developement by forking the repository. We’re looking foreward to review any patches you may provide and hopefully integrate them in the master. Drop us a line if you need advice on implementing or modifying it to fulfill your needs.

Download the code (zip / 164kb)

Acknowledgement & Licensing

Please note that only the DocumentClass.as and everything in the ch.datavisualization package is licensed under the GNU license. IMPORTANT: Please see the documentation of the external packages (com.stamen, com.modestmaps and gs.TweenLite) for their seperate licensing policy.
Some code was inspired by the superb work of Nathan from FlowingData.com.

Share this article

Subscribe for more

Give Feedback

  • http://twitter.com/cdt002/statuses/1142773289 cdt002 (Cliff Thompson)
  • http://twitter.com/cdt002/statuses/1142773289 cdt002 (Cliff Thompson)
  • http://twitter.com/datavis/statuses/1153767933 datavis (Datavisualization.ch)

    Major update to the MM Construct: new MM library and navigation extras. See for yourself: http://bit.ly/EHsl

  • Akropp

    is there anywhere to see the source of your sample application?

    • http://www.artillery.ch/ Wiederkehr

      Hi Akropp,
      the sample application is included in the MM Construct download on GITHub. Hope that helps.