Get your own customer support community

Recent activity

Subscribe to this feed
  • question

    fnicollet replied on May 18, 2009 06:59 to the question "Working on scales that aren't power-of-two ?" in Modest Maps:

    fnicollet
    I don't think thats such a good idea to implement it in ModestMap either cause it's very specific. I was just trying to help Lorenzo there if he wants to do it too ;)
  • question

    fnicollet replied on May 14, 2009 14:23 to the question "Working on scales that aren't power-of-two ?" in Modest Maps:

    fnicollet
    i couldn't get rid of thepower of two assumption for my Tile Cache layers.
    Instead, i just have no transitions and the other layers are not displayed (there is an offset between the zoomed layers and the layers being loaded if the difference is not a power of two).
    There was just too much to change in MM (i created my own lib over MM instead).
    Good luck with that Lorenzo!

    Fabien
  • update

    fnicollet replied on February 16, 2009 09:19 to the update "Modest Roadmap!" in Modest Maps:

    fnicollet
    Well some could be complex and some could be simple ^^. And there will be some editing tools as well (point edition and free transform tool), text annotations and stuff like that so i made a clear structure and tried redo-ing it all.
    These geometries will be both used for analysis and for drawing so i'm currently having a look at the HeatMap samples included in the MM samples. I'm gonna try this Michael Vandanike's technique and the few others lib available in as3, see which one looks the best :).
    Thx
  • update

    fnicollet replied on February 16, 2009 08:53 to the update "Modest Roadmap!" in Modest Maps:

    fnicollet
    Awesome work RandowEtc :D

    Modest Maps is a great lib and the most flexible i've found so far.
    There are some vector layers in the flicker gallery, is that also related to an ongoing MM project, or maybe to a Stamen project ?
    http://www.flickr.com/photos/straup/3...
    I'm currently implementing vector layers as well on top of MM, following these specs (very useful to organize his code):
    http://www.opengeospatial.org/standar...
    Maybe it could be helpful :)
  • idea

    fnicollet replied on February 13, 2009 15:59 to the idea "How to layer two maps with different providers (for blending, alpha transparency, etc)" in Modest Maps:

    fnicollet
    Hi Opa,
    Within a Flex project, you won't need to set the StageAlign property. But the stage property should be accessible on applicationComplete (and not on the creationComplete event) so i don't rly know why there is an error. Just delete this line and you'll be fine :)
    The easiest solution to add a MM in Flex is to create an <mx:uicomponent> in your flex application. Then in a script block, you can just create a new map (using the new keyword with the name of your main MM class, the one that had the stage.align thingie) and as this new map extends Sprite, you can directly add it to your UIComponent. To do so, simply call something like:
    mapCont.addChild(myNewMap);
    And everything should work fine then :)
    If you have any problem with Flex implementation, ask me, i think i can help.</mx:uicomponent>
  • idea

    fnicollet replied on February 13, 2009 15:39 to the idea "Optimization of Modest Maps for embedded systems" in Modest Maps:

    fnicollet
    I've been looking at the memory of my application (using few differents maps at the same time) and i have to say its pretty well managed. The object pool is per defauly using max env. 60Mo per layer in memory but you can modify this value using the DEFAULT_MAX_TILES_TO_KEEP constant in TileGrid.as (default is 256 tiles kept in memory).
    After that, the object pool used to increase performance does his job and memory doesn't get off the roof.
    If you are trying to find some leaks in an application, i strongly recommand the Flex Profiler that comes with Flex Builder 3 (works with pure AS projects too). If you are not familiar with this tool, it helps keeping track of live objects (and their back references), memory usage and performances.
  • question
  • star

    fnicollet marked one of RandomEtc's replies in Modest Maps as useful. RandomEtc replied to the question "How to clear cached tiles for a layer ?".

  • question

    fnicollet asked a question in Modest Maps on January 29, 2009 17:38:

    fnicollet
    How to clear cached tiles for a layer ?
    Hi all,
    for some obscure reasons, i need to clear cached tiles from a TileGrid. Caching is really well done (congrats ^^) but it's quite hard to see how i could do that easily and clean.
    Could you could please help me working it out ?

    Thanks again
    Fabien
  • question
  • star

    fnicollet marked one of RandomEtc's replies in Modest Maps as useful. RandomEtc replied to the question "Signification of the "dirty" variable ?".

  • question

    fnicollet asked a question in Modest Maps on January 23, 2009 14:53:

    fnicollet
    Signification of the "dirty" variable ?
    Hi all,
    could someone try to explain what this "dirty" variable is for ? It's a member of TileGrid.as and used quite a lot but i don't really get what it is for.

    Thanks :)
    Fabien
  • question

    fnicollet replied on January 22, 2009 08:34 to the question "Working on scales that aren't power-of-two ?" in Modest Maps:

    fnicollet
    Well the original data (raster images) is like this and i can't change it. I kept my implementation (setExtent at every zoom, dont tween the grid) and set the parent/child seach to sothat there is only my layer displayed.
    Tiles from TileCache are really fast and will surely be on a local network so the loading time isn't really a problem.
    It may be a bit quick and dirty but i think it saved me a lot of headaches :D
  • question

    fnicollet asked a question in Modest Maps on January 21, 2009 11:09:

    fnicollet
    Working on scales that aren't power-of-two ?
    Hi all,
    i'm trying to implement TileCache with ModestMaps. Here is an example of the TileCache descriptor i have:

    <?xml version="1.0" encoding="UTF-8" ?>
    - <TileMap version="1.0.0" tilemapservice="http://192.168.3.227:8080/appone/tilecache/ctx1/tilemapservice.xml">
    <Title>default</Title>
    <Abstract>Context ctx1 - Map map1 - Entity default</Abstract>
    <SRS>EPSG:27562</SRS>
    <BoundingBox minx="295000.0" miny="130000.0" maxx="326000.0" maxy="150000.0" />
    <Origin x="295000.0" y="130000.0" />
    <TileFormat width="256" height="256" mime-type="image/png" extension="png" />
    - <TileSets profile="local">
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/0" unit-per-pixel="176.38888888888889" order="0" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/1" unit-per-pixel="88.19444444444444" order="1" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/2" unit-per-pixel="35.27777777777778" order="2" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/3" unit-per-pixel="17.63888888888889" order="3" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/4" unit-per-pixel="8.819444444444445" order="4" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/5" unit-per-pixel="3.5277777777777777" order="5" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/6" unit-per-pixel="1.7638888888888888" order="6" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/7" unit-per-pixel="0.8819444444444444" order="7" />
    <TileSet href="http://192.168.3.227:8080/appone/tilecache/ctx1/1.0.0/default/8" unit-per-pixel="0.3527777777777778" order="8" />
    </TileSets>
    </TileMap>


    As you can see, some transitions are not power-of-2 so it's working fine when i go from zoom level 2, to ZL 3, to ZL4, but not when i go to ZL5 (8.8/2 != 3.5).

    I already managed to re-calculate the right bounds using origin and upp so that i can call setExtent. But when i try to zoom in and out, the cached tiles don't line up ok. I guessed it was because my worldMatrix grid was wrong when i apply a scale that is not a power-of-2.

    Do you think that's even possible to line-up the grid with the new extent or i should just change the parent/child search to 0 so that it doesn't search for cached tile on other levels?

    Thanks
    Fabien
  • idea

    fnicollet replied on January 19, 2009 20:27 to the idea "[Tutorial] - Using WMS Map Provider with ModestMaps (epsg:4236 and epsg:900913)." in Modest Maps:

    fnicollet
    Well right now the power of 2 thing isn't working, i just totally changed the setExtent method to calculate the centerCoord from the informations coming from the XML (origin/scales), which is already a bit of a mess. So i determine which zoom level is the most appropriate and calculate the centerCoord row and column from the origin and the resolutions.
    And to determine the number of tiles in a row or in a column, you can't use zoom*zoom because unlike world-maps, they may not be square so u have to calculate it all the time (but i think i will just pre-calculate them when loading).
    This way, i can use the zoomBox (bit rewritten too) and set the initial extent.

    As u said, the power-of-2 is a really core feature so there may be too much stuff to rewrite and i may end-up just calculating the extent manually and setExtent with it or something.
    i'll keep u posted :)
  • idea

    fnicollet replied on January 19, 2009 19:42 to the idea "[Tutorial] - Using WMS Map Provider with ModestMaps (epsg:4236 and epsg:900913)." in Modest Maps:

    fnicollet
    Well this is just a simplified sample from what i've written so far. A colleague of mine has written a class to parse the GetCapabilities XML but i didn't have time to review it yet.

    The openlayers WMS server has a crossdomain file:
    http://labs.metacarta.com/crossdomain...
    But i don't know what this site-control tag is about so idk if it would work ok.

    At the moment, i'm more focused on trying to make ModestMaps work with TileCache. It's a bit tricky cause there are many many differents things compared to the usual map providers. Like the map doesn't have to be square, scales are not a power of 2 (can be like 10K, 5K and then 2K, not 2.5K), the origin is the bottom left corner, the tiles can be bigger than the bounding box and the map can be in any projection so i had to rewrite a lot of code to make it work properly. You have to read and parse an XML as well to get the scales values.
    I pretty much made it work so far (i can set an extent and zoom box), there is still the "double clic zoom" that i need to work out but its a mess with these scales that aren't a power of 2 :P

    I'll post some more maybe when it will be clean enough :)
  • idea

    fnicollet replied on January 19, 2009 18:46 to the idea "[Tutorial] - Using WMS Map Provider with ModestMaps (epsg:4236 and epsg:900913)." in Modest Maps:

    fnicollet
    Cool :D
    i got this wms list i've been testing with (randomly):

    // serveur geosignal
    //private var serverUrl:String = "http://www.geosignal.org/cgi-bin/wmsmap";
    //private var wms:String = "?LAYERS=Nationales&FORMAT=image%2Fpng&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&WIDTH=256&HEIGHT=256&BBOX=";
    // serveur fire information
    //private var serverUrl:String = "http://maps.geog.umd.edu/wmsconnector/com.esri.wms.Esrimap";
    //private var wms:String = "?LAYERS=0,1&FORMAT=image%2Fpng&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&PORT=1200&BBOX=";
    // ecogis (suisse)
    //private var serverUrl:String = "http://www.ecogis.admin.ch/fr/wms";
    //private var wms:String = "?LAYERS=chseen&FORMAT=image%2Fpng&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&BBOX=";
    // canada birds (déformé)
    //private var serverUrl:String = "http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp";
    //private var wms:String = "?LAYERS=IBA&FORMAT=image%2Fpng&ServiceName=ESRI_World&WMTVER=1.0.0&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&BBOX=";
    // points sur l'inde. Server list http://www.who.int/tools/geoserver/ma...
    //private var serverUrl:String = "http://www.who.int/tools/geoserver/wms";
    //private const wms:String = "?LAYERS=WHO:mm_ppoint&FORMAT=image%2Fpng&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&EPSG:900913&WIDTH=256&HEIGHT=256&PORT=1200&BBOX=";
    //private var wms:String = "?LAYERS=WHO:mm_ppoint&FORMAT=image%2Fpng&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&EPSG:900913&WIDTH=256&HEIGHT=256&PORT=1200&BBOX=";
    // cubewerx
    //private var serverUrl:String = "http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi";
    //private var wms:String = "?LAYERS=BATIMEN_A:nrcan&FORMAT=image%2Fpng&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:900913&WIDTH=256&HEIGHT=256&BBOX=";
    // canada
    private var serverUrl:String = "http://wms.geobase.ca/wms-bin/cubeserv.cgi";
    private var wms:String = "?LAYERS=DNEC_250K:ELEVATION/ELEVATION&FORMAT=image%2Fpng&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&BBOX=";
    // tst As3maplib
    //private var serverUrl:String = "http://labs.metacarta.com/wms/vmap0";
    //private var wms:String = "?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&WIDTH=256&HEIGHT=256&BBOX=";

    If you want some more, you can look for "wms getcapabilities" over google and u'll get all the xml description files with layer/server lists
  • idea

    fnicollet replied on January 19, 2009 09:12 to the idea "[Tutorial] - Using WMS Map Provider with ModestMaps (epsg:4236 and epsg:900913)." in Modest Maps:

    fnicollet
    Sounds great, thanks for rewriting it in a clean way ^^. Would be cool to add it to the repository :).

    PS: The port argument is not necessary actually, its just some old copy/paste.
  • idea

    fnicollet shared an idea in Modest Maps on January 16, 2009 08:35:

    fnicollet
    [Tutorial] - Using WMS Map Provider with ModestMaps (epsg:4236 and epsg:900913).
    There has been many people here trying to implement a WMS provider (including me ^^) and i finally worked it out using MM map providers so i thought i would share it.
    First of all, download the Modest Map library from SVN, not the SWC from the home page, its much much better :).
    Then create a new class exactly like OpenStreetMapProvider (same signatures, same imports, same methods) and add two member variables:
    private var serverUrl:String = "http://maps.geog.umd.edu/wmsconnector/com.esri.wms.Esrimap";
    private var wms:String = "?LAYERS=0,1&FORMAT=image%2Fpng&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&PORT=1200&BBOX=";
    if you are using a 4236 projection, add a different projection to your constructor:
    var t:Transformation = new Transformation(166886.05360752725, 0, 524288,
    0, -166886.05360752725, 524288);
    __projection = new LinearProjection(20, t);
    If you are using a 900913 projection, don't change anything it should be working fine as google mercator is the basic projection in MM.
    For the getTileUrls method, write:

    public function getTileUrls(coord:Coordinate):Array
    {
    var boundingBox:String = "";
    var sourceCoord:Coordinate = sourceCoordinate(coord);
    var leftBottomCoord:Location = coordinateLocation(coord.down());
    var topRightCoord:Location = coordinateLocation(coord.right());
    boundingBox = leftBottomCoord.toWMSString()+ "," + topRightCoord.toWMSString();
    trace ("boundingBox: "+serverUrl + wms + boundingBox);

    return [serverUrl + wms + boundingBox];
    }

    And in Location.as, add the following method (its just to invert lat/lon in a clean way):

    public function toWMSString(precision:int=5):String
    {
    return [lon.toFixed(precision), lat.toFixed(precision)].join(',');
    }

    I work with Flex Builder but you can easily adapt this. Create an ActionScript Project, copy the library and add your provider (i called it TestWMSProvider).
    In your main application file, just put:

    package {
    import com.modestmaps.Map;
    import com.modestmaps.TweenMap;
    import com.modestmaps.extras.MapControls;
    import com.modestmaps.mapproviders.TestWMSProvider;

    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;

    public class TutorialWMSModestMap extends Sprite
    {
    public var map:Map;

    public function TutorialWMSModestMap()
    {
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    map = new TweenMap(stage.stageWidth, stage.stageHeight, true, new TestWMSProvider());
    addChild(map);
    addChild(new MapControls(map));
    }
    }
    }


    And this is what you will get !


    I also worked out how to load some TileCache (local profile) with any projection (inc. not 4236 and 900913) but it's very specific and still a bit bugged ^^

    Hope this helps!
  • idea

    fnicollet replied on January 12, 2009 16:23 to the idea "Modest Maps 2.0?" in Modest Maps:

    fnicollet
    hi Grispoo,
    i'm currently trying to code my own library based on ModestMaps that could use
    - tile layers (from MS/Yahoo or TileCache)
    - image layers from a local server (requested analysis, not tiled)
    - drawing layers: i already created a small library that allow me to create/edit polygons/polylines/ellipsis and points with a few tools like snap to points, free transform...

    I'm using a transparent overlay that catch every mouseEvent and redispatch them to the different layers.
    I would like to add support for WMS/WFS that are not in the google mercator projection, but i'm kinda stuck on the different EPSG projections and transformations.
    If you are allowed to, i would like to share some code, with you :)

    Fabien
    (fnicollet@gmail.com)
next » « previous