Flex: Modest Maps – Demo update to version 1.0 library.
I have updated both the Modest Maps demos to use the newly released v1.0 Modest Maps library.

New ones:
Simple demo Flex builder project in zipped form here.
London BBC Jam Cams demo Flex builder project in zipped form here.
I have tagged the new demos with “_v1″ to denote them from the old ones. The reason for this is that the new library is much slower at rendering the map tiles (at least for my demos) than the old one and you might want to use the old ones for now.
Old ones:
Simple demo Flex builder project in zipped form here.
London BBC Jam Cams demo Flex builder project in zipped form here.
I had a look at the new lib source code and for the Flex map it is still missing a “commitProperties” method to set the properties properly after the the map has been created. I feel responsible for this as I didn’t flag it up in the first place with the Modest Maps developers.
I have not updated the online demos with the new code until I find out what is going on so remember that the online ones use the old code.
Old Demos:
Simple demo here.
London BBC Jam Cams demo here.
The missing code is in the map.as file for the Flex map (under the flex directory)
override protected function commitProperties():void
{
super.commitProperties();
if (_map!=null)
{
if (mapZoomDirty)
{
_map.setZoom(_zoom);
mapZoomDirty = false;
}
if (mapCenterDirty)
{
_map.setCenter(_centerLocation);
mapCenterDirty = false;
}
if (mapExtentDirty)
{
_map.setExtent(_extent);
mapExtentDirty = false;
}
}
}
Without this the zoom-in/zoom-out functionality for the map won’t work. Neither will any attempt to set the centre have any effect.
Comments
3 Responses to “Flex: Modest Maps – Demo update to version 1.0 library.”
Leave a Reply
Do you know if it’s possible to put the modest map control anywhere besides the top left corner?
Great work btw!
Cheers.
I haven’t tried it but I have seen another site which had it in a different position. It’s just a bog-standard Flex slider.
hey.. thanks for your work. I just spent the last 12 hours trying to get center to work. wow! what a pain.
plugged in the override and it just works.