[ka-Map-users] Kamap layer in Openlayers

Allan Gyldendal Frederiksen agf at syddjurs.dk
Fri Apr 10 16:16:49 EST 2009


Sorry I didn´t think about it. But it is quite similar. Here is the Openlayers code for Webkort.syddjurs.dk

The Openlayer Code is referenced locally because I use the download from Openlayers.org

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>OpenLayers KaMap Example</title>
    <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
    <link rel="stylesheet" href="style.css" type="text/css" />
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map;
        function init(){
				
            map = new OpenLayers.Map ( $('map'), {maxExtent: new OpenLayers.Bounds(545869, 6217995, 639525, 6256572), maxResolution: 'auto', i:'png', projection:"EPSG:25832", 'controls': [], units: "m"  } );
						var options = { scales: [220000, 150000, 100000, 50000, 25000, 10000, 5000, 2500, 1000] };
            var syddjurs_kamap = new OpenLayers.Layer.KaMap( "Oversigtskort",
                    "http://webkort.syddjurs.dk:8080/kamap/tile.php", {map: "gmap"});       							
										
            map.addLayers([syddjurs_kamap]);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.zoomToMaxExtent();
        }
    </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>



Allan


-----Oprindelig meddelelse-----
Fra: Lorenzo Becchi [mailto:lorenzo at ominiverdi.com] 
Sendt: 8. april 2009 13:32
Til: Allan Gyldendal Frederiksen
Cc: ka-map-users at lists.maptools.org
Emne: Re: [ka-Map-users] Kamap layer in Openlayers

Allan, can you please provide a copy of your OL page that try to use the working ka-map you have at syddjurs.dk?
you've have sent us the code of your localhost app and there's no way for us to check it.

lorenzo

Allan Gyldendal Frederiksen wrote:
> I have tried to load a kamap layer in Openlayers.
> I have used the Kamap example from Openlayers. The problem is, that 
> the example do not work properly. I have searched Kamaps mailinglists, 
> and altered the code accordingly. But it still do not work.
> I have a working Kamap application at 
> http://webkort.syddjurs.dk:8080/kamap/ but using this gives the same 
> result as the local application.
> Does anyone have an idea of what I am missing to get it working.
> The Openlayers code is:
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title>OpenLayers KaMap Example</title> <link rel="stylesheet" 
> href="../theme/default/style.css"
> type="text/css" />
> <link rel="stylesheet" href="style.css" type="text/css" /> <script 
> src="../lib/OpenLayers.js"></script>
> <script type="text/javascript">
> var map;
> function init(){
>
> map = new OpenLayers.Map ( $('map'), {maxExtent: new 
> OpenLayers.Bounds(545869, 6217995, 639525, 6256572), maxResolution:
> 'auto', i:'png', projection:"EPSG:25832", 'controls': [], units: "m" } 
> ); var options = { scales: [220000, 150000, 100000, 50000, 25000, 
> 10000, 5000, 2500, 1000] }; var syddjurs_kamap = new 
> OpenLayers.Layer.KaMap( "Oversigtskort", 
> "http://127.0.0.1:8080/kamap/tile.php", {map: "gmap"});
>
> map.addLayers([syddjurs_kamap]);
> map.addControl(new OpenLayers.Control.LayerSwitcher());
> map.zoomToMaxExtent();
> }
> </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>
>
> Venlig hilsen
>
> *Allan Gyldendal Frederiksen*
> GIS-Koordinator
> IT-afdelingen
>
> Direkte 87535261
> Mobil 30924749
> agf at syddjurs.dk
> ----------------------------------------------------------------------
> -- Syddjurs Kommune * IT-afdelingen * Hovedgaden 77 * 8410 Rønde * Tlf 
> 87535000 * www.syddjurs.dk <http://www.syddjurs.dk/>
> ----------------------------------------------------------------------
> --
>
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>   




More information about the ka-Map-users mailing list