Recent activity
Subscribe to this feed
bill replied on September 10, 2007 17:01 to the question "Whats wrong with this AS3 + Markers hack?" in Modest Maps:
I've summarized all deleted all the tile discontinuity stuff I'd thrown into this thread. Go here instead: http://getsatisfaction.com/modestmaps...
bill reported a problem in Modest Maps on September 10, 2007 16:59:
AS3 tile discontinuity after panningI'm breaking info out of the thread I started writing it in, on account of it taking over that otherwise dead thread.
Originally, "I've had some issues with tiles not being flush after recentering (either via double click or API calls, AS3 codebase)."
Basically, tiles aren't being positioned to round numbers, and the Flash engine deals with this poorly, creating gaps between tiles.
Note that TileGrid's NormalizeWell method appears to realize this can be an issue, but this only fires after zooms, not after pans. Calling it after a pan has it own set of issues (circular loops, and also as below).
Rounding TileGrid.as's centerWell method's adjustTiles deltas fixes this, but breaks other stuff. Notably, panning gets rounding into multiples of map.as's "panFrames" (by default, 12).
Want to pan 5 pixels? You'll pan Math.round(5/12)*12 = 0 pixels.
Want to pan 6 pixels? You'll pan Math.round(6/12)*12 = 12 pixels.
I think I have a pretty decent fix for all this. I've overrided the x and y properties to Tile.as, keeping track of unrounded position, but also setting the real x/y's to rounded values.
Things looks pretty decent with this fix. Here is the meat of it:
protected var __x:Number;
protected var __y:Number;
public override function get x():Number
{
return this.__x;
}
public override function set x(_lx:Number):void
{
this.__x = _lx;
super.x = Math.floor(_lx);
}
public override function get y():Number
{
return this.__y;
}
public override function set y(_ly:Number):void
{
this.__y = _ly;
super.y = Math.floor(_ly);
}
bill replied on August 20, 2007 04:03 to the question "Whats wrong with this AS3 + Markers hack?" in Modest Maps:
bill replied on August 13, 2007 17:47 to the discussion "AS3 quirks with markers, providers, navigation" in Modest Maps:
-
bill started following the discussion "AS3 quirks with markers, providers, navigation" in Modest Maps.
bill replied on August 09, 2007 14:45 to the question "Draw a line into a map obtained via ModestMap" in Modest Maps:
I'm not sure I understand what you're asking, but I'll give it a shot. Assuming you're using the correct coordinate system, you'd use the map's locationPoint method as defined in Map.as...
/**
* Get a point (x, y) for a location (lat, lon) in the context of a given clip.
*
* @param Location to match.
* @param Movie clip context in which returned point should make sense.
*
* @return Matching point.
*/
public function locationPoint(location:Location, context:MovieClip):Point{ ... }-
bill started following the question "Draw a line into a map obtained via ModestMap" in Modest Maps.
bill asked a question in Modest Maps on August 08, 2007 22:49:
Whats wrong with this AS3 + Markers hack?I'm using the AS3 code from Rev. 330 of the SVN trunk. I'm trying to hack in visible markers by adding "markr" buttons to the tile "well" sprite. (This makes panning look good.) For some reason the markers aren't responding to their mouse events. What's special about this "well" thats breaking mouse events (or what I'm doing wrong otherwise)?
Here's the relevant code:
// Grab an instance of the grid's "well"
var well:Sprite = Sprite(map.grid.getChildByName("well"));
// Create an event handler for marker clicks
function traceClick(event:MouseEvent):void{
trace("Real Target " + event.target + ":" + event.target.name);
trace("You clicked " + event.currentTarget + ":" + event.currentTarget.name);
trace("Bubbles? : " + event.bubbles);
}
// Create an event handler for map MarkerEvent.ENTER
function onMarkerEnters(ev:MarkerEvent):void {
var pointXY:Point = map.locationPoint( ev.location, well );
var mark:DisplayObject = well.addChild(new markr());
mark.name = ev.marker;
mark.x = pointXY.x;
mark.y = pointXY.y;
mark.addEventListener(MouseEvent.CLICK, traceClick);
}
map.addEventListener(MarkerEvent.ENTER, onMarkerEnters);
Loading Profile...


