Get your own customer support community

Recent activity

Subscribe to this feed
  • idea

    A comment on the idea "Polyline Overlays without circles in them" in Modest Maps:

    Chris
    Hello,

    sorry that it has taken me so long, but I really have had no time. I was going to go for a bigger fix but right now I would just like to post the minimal solution to solve this issue:


    // Clip each point and draw if visible
    if (clipLineToRect(tPoint1,tPoint2,boundaryWindow)) {
    if (i == 1 || !tPoint1.equals(localPointsArray[i-1])) {
    this.graphics.moveTo(tPoint1.x,tPoint1.y);
    }
    this.graphics.lineTo(tPoint2.x,tPoint2.y);
    }



    all that should be needed is adding this extra if clause. i would be really happy if this was tested and implemented into the modestmaps lib inside the PolylineClip class in the method updatePolyline

    i have some ideas for future enhancements, but i unfortunately dont have time :( – Chris, on July 31, 2009 21:25
  • idea

    Chris replied on June 09, 2009 18:04 to the idea "Polyline Overlays without circles in them" in Modest Maps:

    Chris
    Hey RandomEtc,

    just wanted to say that i did not forget about this, but these days i did not have a minute of free time. I will post the code for flash 9 as soon as i manage to implement it.

    Regards
    Chris
  • idea

    A comment on the idea "Polyline Overlays without circles in them" in Modest Maps:

    Chris
    Hi RandomEtc,

    thanks for the reply. actually I'm not a fan of subclasses either, but I did not want to touch or modify the modestmaps api, so that I can use a new release of modestmaps right away without reimplementing my changes. By the way, is anybody still working on it or is it not getting developed any further?

    do you think it is possible to get this "feature" into the modestmaps api, maybe if we rewrite my implementation so that it targets flash player 9?

    regards
    chris – Chris, on June 02, 2009 19:58
  • idea

    Chris shared an idea in Modest Maps on June 01, 2009 17:09:

    Chris
    Polyline Overlays without circles in them
    Hello,

    i was playing around with the Polyline Overlay drawing a route on a map. Unfortunately the polyline had some circles in it, because every line segment in it was drawn with a moveTo and lineTo command, so that it could be clipped. See the circles in the following picture:



    The circles always appear, when not using alpha = 1.

    So i thought, why not only call a new moveTo command when the previous line segment did not have to be drawn. So I extended the PolylineClip class and overrode the updatePolyline function as following:

    override public function updatePolyline(polyline:Polyline):void
    {
    var w:Number = map.getWidth() * 2;
    var h:Number = map.getHeight() * 2;

    var boundaryWindow:Rectangle=new Rectangle(-w/2,-h/2,w,h);

    var commands:Vector.<int> = new Vector.</int><int>();
    var data:Vector.</int><number> = new Vector.</number><number>();
    var nextCommand:int = GraphicsPathCommand.MOVE_TO;

    // Calculate local coordinates for each point
    for (var i:uint = 1; i < polyline.locationsArray.length;i++)
    {
    var p1:Point = map.locationPoint(polyline.locationsArray[i - 1] as Location, this);
    var p2:Point = map.locationPoint(polyline.locationsArray[i] as Location, this);
    if (clipLineToRect(p1, p2, boundaryWindow)) {
    commands.push(nextCommand);
    nextCommand = GraphicsPathCommand.LINE_TO;
    data.push(p1.x, p1.y);
    } else {
    nextCommand = GraphicsPathCommand.MOVE_TO;
    }
    }
    this.graphics.lineStyle(polyline.lineThickness,polyline.lineColor,polyline.lineAlpha,polyline.pixelHinting,polyline.scaleMode,polyline.caps,polyline.joints,polyline.miterLimit);
    this.graphics.drawPath(commands, data);
    }
    </number>


    (SORRY: The forum messed up the code a little, it's supposed to be var commands:Vector.<int> = new Vector.<int>(); and in the data one the theres the same problem)

    As you can see, I am targeting flash player 10 with this solution already using the vector type and the drawPath command. Now the result looks like this:



    So now I would like to know, what you think about this solution. Would there have been another possibility to achieve this without subclassing PolylineClip? Or would there be a better way to do this with subclassing PolylineClip?

    Or is there a chance of getting this into the modestmaps api, so that i can throw my subclass away and it always acts like this?

    Regards
    Chris
  • question

    Chris replied on May 07, 2009 17:06 to the question "How do I stop the application from scrolling when zooming with the mousewheel?" in Modest Maps:

    Chris
    I found the solution. I had to stop the event propagation like this:

    flexMap.map.addEventListener(MouseEvent.MOUSE_WHEEL, disableEventPropagation);

    private function disableEventPropagation(e:Event):void {
    e.stopPropagation();
    }
  • question
  • question

    A comment on the question "How do I stop the application from scrolling when zooming with the mousewheel?" in Modest Maps:

    Chris
    Yes of course.

    I put a demo right here: http://web0.36214.vs.webtropia.com/sa...

    That is the program i'm playing around with at the moment.

    as you can see, when you use the mousewheel to scroll the map, the application will also scroll. however when you use the mousewheel to scroll the textarea on the bottom right, the application will not scroll.

    I tested this with windows firefox and internet explorer and also with linux firefox and konqueror and got the same result in all combinations.

    if you need anymore information dont hesitate to ask. thanks for you help.

    Chris – Chris, on April 24, 2009 22:08
  • question

    Chris asked a question in Modest Maps on April 24, 2009 20:27:

    Chris
    How do I stop the application from scrolling when zooming with the mousewheel?
    Hi

    I am using the TweenMap in Flex and enabled zooming with the mousewheel something like this:


    flexTweenMap.addEventListener(MouseEvent.MOUSE_WHEEL, (flexTweenMap.map as TweenMap).onMouseWheel);


    This works fine, but unfortunately when I use the mousewheel to zoom into the map, the application will also scroll down (if the application is bigger than the screen and has scrollbars).

    Is there a way I can stop the application from scrolling down aswell?

    Thanks for the help
    Chris
  • question

    Chris replied on March 15, 2009 20:40 to the question "contextmenu in markerclip not working" in Modest Maps:

    Chris
    I still didnt find a solution. does anybody have an idea?
  • question

    Chris replied on March 03, 2009 23:56 to the question "contextmenu in markerclip not working" in Modest Maps:

    Chris
    Hi,

    i tried setting map.markerClip.mouseEnabled to true, but unfortunately that didnt work. After that i additionally set the markers mouseEnabled property to true aswell, but that did not work either :(

    Do you (or anybody else) have another idea, what the problem could be?

    Thanks!
  • question

    Chris asked a question in Modest Maps on February 28, 2009 10:26:

    Chris
    contextmenu in markerclip not working
    Hello,

    I would like to add a markerclip with a contextmenu on a map. The clip appears correctly, but I cant get the contextmenu to work.

    This is the code im using:


    package
    {
    import com.modestmaps.Map;
    import com.modestmaps.geo.Location;

    import flash.display.Sprite;
    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;

    public class Marker extends Sprite
    {
    public var text:String;
    public var location:Location;
    private var map:Map;
    private var cMenu:ContextMenu;

    public function Marker(location:Location, text:String, map:Map)
    {

    this.location = location;
    this.text = text;
    this.map = map;

    graphics.beginFill(0x000000);
    graphics.drawCircle(0,0,12);
    graphics.beginFill(0xff9900);
    graphics.drawCircle(0,0,10);
    graphics.beginFill(0xffff00);
    graphics.drawCircle(0,0,5);

    cMenu = new ContextMenu();
    var item:ContextMenuItem = new ContextMenuItem("Label");
    cMenu.customItems.push(item);
    cMenu.hideBuiltInItems();
    this.contextMenu = cMenu;

    }
    }
    }


    Later i add this on the map like this:


    var marker:Marker = new Marker(new Location(53.28707,9.45686), "Text", map);
    map.putMarker(marker.location, marker);


    Can anybody give me a hint, what I am doing wrong here?

    Thanks
    Chris