[ka-Map-users] Kamap layer in Openlayers

Lorenzo Becchi lorenzo at ominiverdi.com
Fri Apr 10 17:04:53 EST 2009


ka-map's call:
http://webkort.syddjurs.dk:8080/kamap/tile.php?map=gmap&t=-80640&l=7424&s=220000&g=__base__&i=AGGA

your call on OL:
http://webkort.syddjurs.dk:8080/kamap/tile.php?map=gmap&i=jpeg&t=-50432&l=4608&s=351614.7429

my working call on OL:
http://webkort.syddjurs.dk:8080/kamap/tile.php?map=gmap&i=AGGA&g=__base__&t=-80384&l=7424&s=220000

how I did it?!?

the code below

please, close the ticket [1] suggesting them an OL Map using our server 
[2] an layers (bluemarble: '__base__', country borders: 'Countries', 
country names: 'Labels'). Scales: 
'100000000','50000000','25000000','10000000'.
please, do the map yourself to make them easy to add to examples

ciao
lorenzo

[1] http://trac.openlayers.org/ticket/2036
[2] http://ominiverdi.org/ka-map/ka-map/htdocs/
[3] 
http://ominiverdi.org/ka-map/ka-map/htdocs/tile.php?map=cvs&t=-200&l=-400&s=100000000&g=__base__&i=JPEG
[4] 
http://ominiverdi.org/ka-map/ka-map/htdocs/tile.php?map=cvs&t=-200&l=-400&s=100000000&g=Countries&i=PNG
[5] 
http://ominiverdi.org/ka-map/ka-map/htdocs/tile.php?map=cvs&t=-200&l=-400&s=100000000&g=Labels&i=PNG
----------------------------
    ka-map's call:
http://webkort.syddjurs.dk:8080/kamap/tile.php?map=gmap&t=-80640&l=7424&s=220000&g=__base__&i=AGGA

your call on OL:
http://webkort.syddjurs.dk:8080/kamap/tile.php?map=gmap&i=jpeg&t=-50432&l=4608&s=351614.7429

my working call on OL:
http://webkort.syddjurs.dk:8080/kamap/tile.php?map=gmap&i=AGGA&g=__base__&t=-80384&l=7424&s=220000

how I did it?!?

here's the code:
   
   
    <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>OpenLayers KaMap Example</title>
    <script src="http://openlayers.org/api/OpenLayers.js"></script>
    <script type="text/javascript">
        var map;
        function init(){
        var mybounds = new OpenLayers.Bounds(545869, 6217995, 639525, 
6256572)    ;   
        var myscales = [220000, 150000, 100000, 50000, 25000, 10000, 
5000, 2500, 1000] ;
            map = new OpenLayers.Map ( $('map'), {maxExtent: mybounds, 
maxResolution: 'auto', projection:"EPSG:25832",  units: "m"  } );
        var options = { scales: myscales};
            var syddjurs_kamap = new OpenLayers.Layer.KaMap( 
"Oversigtskort",
                    "http://webkort.syddjurs.dk:8080/kamap/tile.php", 
{map: "gmap",i:'AGGA',g:'__base__'},
                {scales:myscales});                                  
                                       
            map.addLayers([syddjurs_kamap]);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.zoomToExtent(mybounds);

        }
    </script>
  </head>
  <body onload="init()">
    <h1 id="title">KaMap Example</h1>

    <div id="tags"></div>

    <p id="shortdesc">
        Demonstrate a tiled kamap layer as the base map, which can be 
pre-cached for higher performance.
    </p>

    <div id="map" class="smallmap"></div>

    <div id="docs"></div>
  </body>
</html>


More information about the ka-Map-users mailing list