<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-&gt;active = TRUE;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer-&gt;name = 'osm_mapnik';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer-&gt;openlayers = "OSM.Mapnik";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer-&gt;title = 'OSM Mapnik';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer-&gt;description = 'The main OpenStreetMap map';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer-&gt;api_url = 'https://www.openstreetmap.org/openlayers/OpenStreetMap.js';</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$layer-&gt;data = array(</div><div><span
 class="Apple-tab-span" style="white-space:pre">                        </span>'baselayer' =&gt; TRUE,</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'attribution' =&gt; '&amp;copy;&lt;a href="@ccbysa"&gt;CCBYSA&lt;/a&gt; 2010</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&lt;a href="@openstreetmap"&gt;OpenStreetMap.org&lt;/a&gt; contributors',</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'url' =&gt; 'http://tile.openstreetmap.org/${z}/${x}/${y}.png',</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'type' =&gt; ''</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-&gt;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&nbsp;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:
 *  - &lt;OpenLayers.Layer.OSM&gt;
 */
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>