<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">Hi,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">I am using the Ushahidi framework and would like to serve my ownbasemaps which come from geoserver (wms and GeoWebCache)</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">There is a class in the Ushahidi framework which I have pasted underneath. It called the layers using the following parameters....</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div><div><font face="arial, helvetica, sans-serif"><div><span class="Apple-tab-span"
style="white-space:pre">                </span>// OpenStreetMap Mapnik</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer = new stdClass();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->active = TRUE;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->name = 'osm_mapnik';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->openlayers = "OSM.Mapnik";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->title = 'OSM Mapnik';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->description = 'The main OpenStreetMap map';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->api_url = 'https://www.openstreetmap.org/openlayers/OpenStreetMap.js';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer->data = array(</div><div><span
class="Apple-tab-span" style="white-space:pre">                        </span>'baselayer' => TRUE,</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'attribution' => '&copy;<a href="@ccbysa">CCBYSA</a> 2010</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span><a href="@openstreetmap">OpenStreetMap.org</a> contributors',</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'url' => 'http://tile.openstreetmap.org/${z}/${x}/${y}.png',</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'type' => ''</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layers[$layer->name] = $layer;</div><div><br></div><div>I would like to adapt this code for my own geoserver instance......but am not sure what/how to change it.</div><div><br></div><div>It references
the OpenStreetMap.js file which defines the maps as this</div><div><br></div><div><pre style="word-wrap: break-word; white-space: pre-wrap; ">/**
* Class: OpenLayers.Layer.OSM.Mapnik
*
* Inherits from:
* - <OpenLayers.Layer.OSM>
*/
OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
/**
* Constructor: OpenLayers.Layer.OSM.Mapnik
*
* Parameters:
* name - {String}
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, options) {
var url = [
"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({
numZoomLevels: 19,
buffer: 0,
transitionEffect: "resize"
}, options);
var newArguments = [name, url, options];
OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
},
CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
});</pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap; ">Can anyone see how I could adapt this code to use a wms or gwc layer coming from http://mydomain/geoserver/wms? with "layername"???</pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap; ">thanks for any suggestions,</pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap; ">yours,</pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap; ">Rob</pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre><pre style="word-wrap: break-word; white-space: pre-wrap; "><br></pre></div></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div></div></div></body></html>