how to adapt an api for my own wms layers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

how to adapt an api for my own wms layers


I am using the Ushahidi framework and would like to serve my ownbasemaps which come from geoserver (wms and GeoWebCache)

There is a class in the Ushahidi framework which I have pasted underneath. It called the layers using the following parameters....

// OpenStreetMap Mapnik
$layer = new stdClass();
$layer->active = TRUE;
$layer->name = 'osm_mapnik';
$layer->openlayers = "OSM.Mapnik";
$layer->title = 'OSM Mapnik';
$layer->description = 'The main OpenStreetMap map';
$layer->api_url = '';
$layer->data = array(
'baselayer' => TRUE,
'attribution' => '&copy;<a href="@ccbysa">CCBYSA</a> 2010
<a href="@openstreetmap"></a> contributors',
'url' => '${z}/${x}/${y}.png',
'type' => ''
$layers[$layer->name] = $layer;

I would like to adapt this code for my own geoserver instance......but am not sure what/how to change it.

It references the OpenStreetMap.js file which defines the maps as this

 * 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 = [
        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"

Can anyone see how I could adapt this code to use a wms or gwc layer coming from http://mydomain/geoserver/wms? with "layername"???

thanks for any suggestions,



Users mailing list
[hidden email]
Yours with thanks, Robert Buckley System: Linux Ubuntu 10.04 Server / Tomcat6 / Geoserver 2.1.2 / GeoWebCache 1.2.6)