Recent activity
Subscribe to this feed
notsofast replied on October 27, 2007 16:41 to the discussion "AS3 quirks with markers, providers, navigation" in Modest Maps:
I am willing to share, especially if someone who is really in tune with Flex might take it and clean it up. I pieced it together from what I could learn in a hurry, and it contains several workarounds for things I couldn't figure out but might have simple answers. I have some immediate issues (2 of my machines went belly up on me yesterday, so I'm scrambling), but I'll try to recover the source ASAP. I wouldn't be the right person to maintain your Flex library: my Flex involvement is occasional, fleeting, and superficial.
notsofast replied on September 11, 2007 03:28 to the problem "AS3 tile discontinuity after panning" in Modest Maps:
-
notsofast started following the problem "AS3 tile discontinuity after panning" in Modest Maps.
notsofast replied on August 23, 2007 12:37 to the question "Whats wrong with this AS3 + Markers hack?" in Modest Maps:
notsofast replied on August 23, 2007 03:23 to the problem "MouseWheelZoomEvent" in Modest Maps:
-
notsofast started following the problem "MouseWheelZoomEvent" in Modest Maps.
notsofast replied on August 17, 2007 03:58 to the question "Whats wrong with this AS3 + Markers hack?" in Modest Maps:
It appears that the modestmaps.Map object is instantiated later than before. Is there a recommended way to tell when it has been created so I can get the ref to the Map object from the flex.Map object? I was getting it in a callback attached to the Flex app's initialize event, but now it's coming back null.
notsofast replied on August 14, 2007 20:41 to the question "Whats wrong with this AS3 + Markers hack?" in Modest Maps:
notsofast replied on August 14, 2007 04:35 to the discussion "AS3 quirks with markers, providers, navigation" in Modest Maps:
My approach is pretty simple:
I created the marker as a MovieClip in Flash, made that into a symbol (called SpotMarkerMC), then exported it as a .swc, and made an ActionScript class (public class SpotMarker extends SpotMarkerMC { ...). In my Flex app, I create instances of modestmaps.Marker that I give to the modestmaps.Map object using putMarker(), and instances of SpotMarker that I attach to the modestmaps.flex.Map object using addChild(). I have callbacks attached to the marker ENTER and LEAVE events that add and remove SpotMarkers from an active list. I have callbacks attached to the ZOOM and PAN events that update the position of each marker in the active list and clip the markers wrt the map boundary, by calling moveMarkers():
private function moveMarkers(event:MapEvent=null):void {
// For each active marker, move it, then see whether its
// visibility needs to be changed.
for (var markerId:String in _activeMarkers) {
var m:Marker = _allMarkers[markerId];
var pt:Point = _map.locationPoint(m.location, _flexMap.map);
var mClip:SpotMarker = _allMarkerClips[m.id];
// put the marker's hotspot at the desired location
mClip.x = pt.x - _markerOrigin.x;
mClip.y = pt.y - _markerOrigin.y;
// When marker leaves the map boundaries, hide it. This can happen
// before it is removed from the map (when its tile goes away).
// The reverse for showing it.
if (mClip.x < 0 || mClip.x > _flexMap.width ||
mClip.y < 0 || mClip.y > _flexMap.height) {
mClip.visible = false;
}
else {
mClip.visible = true;
}
}
}
I'm looking forward to checking out the latest update that was announced. Sounds like it will do more of the work to manage the markers.
As a side note: I spent way too much time trying to figure out the right way to export the Flash MovieClip symbol and make it into a proper Actionscript object. I got very confused trying to make it an actual Flex component. What I have now works as long as I compile it into my Flex app. If I tried to load the map marker symbol dynamically I guess I would have to have some sort of interface class defined so I could call methods on it.
So there you have it. In return, maybe someone can tell me how to get double-click events to come through. I can't seem to get any double-click event from the Map object or any of its containers. I set doubleClickEnabled to true and attach a listener, but nothing happens.
notsofast started a conversation in Modest Maps on August 10, 2007 17:03:
AS3 quirks with markers, providers, navigationI'm building a Flex app with your nice map,and have run into a few snags. I suspect they are mostly just things you haven't completed yet in your flex.Map object, but I thought I'd mention them because maybe it's something I've got wrong.
1. Markers can't be created too early. I had to wait for the map to be displayed and zoomed. If I remember correctly, the zoom caused some variable to be initialized that is used to create unique marker IDs. It will be great when flex.Map can manage the marker objects directly.
2. The geo coords don't wrap, so if you pan around the world the markers disappear. Is there a way to clamp the pan (and zoom) to a range?
3. Setting the provider property on flex.Map doesn't seem to work.
4. Is there an easy way to animate to a location or zoom level through an API call?
You can see the current state of the experiment at http://plwmodelworks.com/map.
Looking forward to the next AS3 update! Thanks for the great work.-
notsofast started following the question "Whats wrong with this AS3 + Markers hack?" in Modest Maps.
Loading Profile...


