[OpenLayers-Users] Configure ProxyHost and KML files

Alexandre Dube adube at mapgears.com
Thu Mar 26 08:31:11 EDT 2009


OpenLayers.Format.KMZ doesn't exist.  You should try KML instead and 
have &format=application/vnd.google-earth.kml+XML in your url instead.  
I never tried it thought, but that's what I would try.

By the way, KMZ is a zipped version of a KML.  You could replace a 
file.kmz to file.zip then unzip it and you would have your uncompressed 
KML.  OpenLayers currently can't read KMZ files.

Regards,

Alexandre

Asle Benoni wrote:
> Yes, I have read that and configured proxy.cgi with the domains of the 
> server.
> Now the layer I get from GeoServer is KMZ and not KML (don´t know why) 
> so I put the code like this in my html.
>
> OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
>
>              map.addLayer(new OpenLayers.Layer.GML("KML", 
> "http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kmz+XML&", 
>
>                {
>                 format: OpenLayers.Format.KMZ,
>                 formatOptions: {
>                   extractStyles: true,
>                   extractAttributes: true
>                 }
>                }));
>
> I see now in FireBug that a http request is done to the kmz file but I 
> do not see the layer in the map.
>
> /asle
>
>


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list