Hi everyone,<div><br></div><div>I realize this is more of a server-side/noob question, but it directly relates to OL functionality so I thought it would be good to ask here. I'm trying to dynamically grab flickr feeds and dump them into a map following the example in the OL book. I'm stumped as to how to tailor the OL proxy.cgi script on my local xampp installation. I have python2.7 installed, so I've changed the first line of the proxy.cgi to "#! C:/Python27/python.exe -u" following the example of someone on one of the Mapserver lists. This at least let's me redirect to the OL home page following the examples in the FAQ section (localhost/cgi-bin/proxy.cgi), meaning the script is in the right place and works. However, I'm still getting denied on the cross-domain request so, it has to be an error in my code, my guess would be that it's the URL that I'm providing to the javascript in the proxy host declaration. Any help would be greatly appreciated</div>
<div><br></div><div><div>var map, layer;</div><div>function init_geoflik(){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>map = new OpenLayers.Map ("map", </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{controls:[ </div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span> new OpenLayers.Control.Navigation(),</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>new OpenLayers.Control.PanZoomBar(),</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>new OpenLayers.Control.LayerSwitcher(),</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>new OpenLayers.Control.Attribution(),</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>new OpenLayers.Control.ScaleLine()],</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span>sphericalMercator: true,</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span>maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),</div>
<div> <span class="Apple-tab-span" style="white-space:pre">                </span>maxResolution: 156543.0399,</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span>numZoomLevels: 19,</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span>units: 'm'</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>});</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>// Google Layer as Background<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>var google_map = new OpenLayers.Layer.Google(</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'Google Layer',</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{}</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>map.addLayer(google_map);</div><div>//static fliker data</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>var vector_layer = new OpenLayers.Layer.Vector('Flickr Data',</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>projection: new OpenLayers.Projection('EPSG:4326'),</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>protocol: new OpenLayers.Protocol.HTTP({</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>url: '<a href="http://api.flickr.com/services/feeds/geo/">http://api.flickr.com/services/feeds/geo/</a>', params: {'format':'kml', 'tags':'graphitti'}, format: new OpenLayers.Format.KML({extractAttributes: true, extractStyles: true})}), strategies: [new OpenLayers.Strategy.Fixed(), new OpenLayers.Strategy.Cluster]});</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>map.addLayer(vector_layer);</div><div>//Specify modified proxyhost from OpenLayers<span class="Apple-tab-span" style="white-space:pre">        </span></div><div>OpenLayers.ProxyHost = '/cgi-bin/proxy.cgi?url=';</div>
<div><br></div><div>// interaction controls</div><div>//Add a select feature control</div><div>var select_feature_control = new OpenLayers.Control.SelectFeature(</div><div>vector_layer,</div><div>{}</div><div>)</div><div>
map.addControl(select_feature_control);</div><div>select_feature_control.activate();</div><div>//Add the style map to the vector layer</div><div>vector_layer.styleMap = vector_style_map;</div><div>var vector_style_select = new OpenLayers.Style({</div>
<div>'fillColor': '#cdcdcd',</div><div>'fillOpacity': .9,</div><div>'fontColor': '#232323',</div><div>'strokeColor': '#ffffff'</div><div>})</div><div>//Create a style map object and set the 'default' intent to the</div>
<div>var vector_style_map = new OpenLayers.StyleMap({</div><div>'default': vector_style,</div><div>'select': vector_style_select</div><div>});</div><div>//</div><div>vector_layer.events.register('featureselected', this, on_select_feature);</div>
<div>vector_layer.events.register('featureunselected', this, on_unselect_feature);</div><div>//center map on data loaded</div><div> if( ! map.getCenter() ){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> if(vector_layer){</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span> vector_layer.events.register('loadend', vector_layer, function(){map.zoomToExtent(vector_layer.getDataExtent())});</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> }</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>map.setCenter(null, null);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>};</div><div><br></div><div>//end of fn bracket</div><div>
}</div><div>function on_select_feature(event){</div><div>//Store a reference to the element</div><div>var info_div = document.getElementById('photo_info_wrapper');</div><div>info_div.innerHTML = '';</div><div>
//Store the clusters</div><div>var cluster = event.feature.cluster;</div><div>//Loop through the cluster features</div><div>for(var i=0; i<cluster.length; i++){</div><div>//Update the div with the info of the photos</div>
<div>info_div.innerHTML += "<strong>"</div><div>+ cluster[i].<a href="http://attributes.name">attributes.name</a></div><div>+ "</strong><br />"</div><div>+ "<img src='" + cluster[i].style.externalGraphic + "'/>"</div>
<div>+ cluster[i].attributes.Snippet</div><div>+ "<br /><hr />";</div><div>}</div><div>}</div><div>function on_unselect_feature(event){</div><div>//Store a reference to the element</div><div>var info_div = document.getElementById('photo_info_wrapper');</div>
<div>//Clear out the div</div><div>info_div.innerHTML = '';</div><div>}</div><div><br></div><div><br></div><br>-- <br><br><div>Dept. of Anthropology</div><div>Washington University in St. Louis</div><div>Campus Box 1114</div>
<div>St. Louis, MO, 63130</div><div>(917) 370-3489</div><div><a href="mailto:nefremov@artsci.wustl.edu" target="_blank">nefremov@wustl.edu</a><br></div><br>
</div>