[OpenLayers-Users] Configure ProxyHost and KML files

Asle Benoni asle.benoni at gmail.com
Thu Mar 26 04:30:32 EDT 2009


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


Den 25. mars. 2009 kl. 18.37 skrev Alexandre Dube:

> Hi,
>
> http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost
>
> Regards,
>
> Alexandre
>
> Asle Benoni wrote:
>> Hello,
>> I am new to OpenLayers.  I have made a Feature Set  in GeoServer  
>> and when I click on Demo and show my map it downloads a KMZ file. I  
>> am not sure if this is correct but I can view it in Google Earth  
>> just fine.
>> I am trying to serve a KML file from GeoServer but in FireBug I  
>> see: *Access to restricted URI denied" code: "1012*
>>
>> How do I configure OpenLayers prox.cgi to make things work?
>>
>> This is the OpenLayers code:
>>
>> map.addLayer(new OpenLayers.Layer.GML("KML", "http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne 
>> ",                {
>>                format: OpenLayers.Format.KML,                  
>> formatOptions: {
>>                  extractStyles: true,                    
>> extractAttributes: true
>>                }
>>               }));
>>
>> Thanks for any advice!
>>
>> /asle
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>
>
> -- 
> Alexandre Dubé
> Mapgears
> www.mapgears.com
>




More information about the Users mailing list