Hi,
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 = 'https://www.openstreetmap.org/openlayers/OpenStreetMap.js';
$layer->data = array(
'baselayer' => TRUE,
'attribution' => '©<a href="@ccbysa">CCBYSA</a> 2010
<a href="@openstreetmap">OpenStreetMap.org</a> contributors',
'url' => 'http://tile.openstreetmap.org/${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 = [
"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"
});
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,
yours,
Rob_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users