[OpenLayers-Users] Problems displaying kmz file in OpenLayers

Asle Benoni asle.benoni at gmail.com
Thu Mar 26 12:08:23 EDT 2009


Hi,
I am really frustrated about not beeing able to display a kmz layer in  
OpenLayers.
Here is the code:

                 map.addLayer(new OpenLayers.Layer.GML("Gravminne", "http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kml+XML&transparent=true&srs=EPSG:4326&transparent=true& 
",
                {
                 format: OpenLayers.Format.KML,
                 formatOptions: {
                   extractStyles: true,
                   extractAttributes: true,
                   transparent:true
                 }
                }));

I can see the http request from the proxy so it is fetching correct  
data (I think) but I cannot see any on the map!
The request looks like this (FireBug). I am not sure if the EPSG is  
correct. I also tried "EPSG:32632" which I set for the map.

http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth
.kml+XML&transparent=true&srs=EPSG:4326&

But in the response I see
<href><![CDATA[http://naturkart.no:8080/geoserver/wms?format_options=KMPLACEMARK%3Afalse
%3BKMATTR%3Atrue%3BKMSCORE%3A50%3BSUPEROVERLAY%3Afalse 
%3B&service=wms&srs=EPSG%3A4326&width=1024&styles
= 
point 
&height=1024&transparent=false&request=GetMap&layers=kulturminner_ns 
%3Agravminne&format=application
%2Fvnd.google-earth.kmz%2Bxml&version=1.1.1]]></href>


Can anyone point to how to show a KMZ file from GeoServer as I need  
the options for that layer format. I checked the docs but did not get  
wiser.

Thanks.
/asle



More information about the Users mailing list