[OpenLayers-Users] Basic GeoServer OpenLayers map
Frank Broniewski
brfr at metrico.lu
Fri Apr 23 08:37:25 EDT 2010
Hello Steven,
unfortunately I have no experience with geoserver, but request URLs from
Openlayers WMS are conform to the OGC standards and if geoserver is also
conform there should'nt be a problem. A OL generated request from my
application:
http://www.gis-hosting.lu/ogc/service/osm?LAYERS=label&STYLES=,,,&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A2169&BBOX=67416.666666,70311.458332975,88583.333334,81688.541667025&WIDTH=1200&HEIGHT=645
It is in the Net tab from firebug. Something like GET osm?LAYERS= ...
If you suspect the problem with geoserver you could try the WMS requests
in your browser so you can be sure that they are working. If you think
its a OL configuration problem please show your layer config code so
that we can search there ...
A OL WMS Layer example:
new OpenLayers.Layer.WMS(
'WMS',
'http://www.gis-hosting.lu/ogc/service/osm',
{
layers: ['base','traffic','place-label'],
styles: ['','','',''], format: 'image/png'
},
{
isBaseLayer: true,
singleTile: true
}
);
Frank
Am 23.04.2010 14:11, schrieb Steven Venter:
> Hi Frank
>
> Thanks for replying.
>
> I used firebug to look at the requests being sent to the server. The css
> stuff and the navigation items are requested but no request to fetch the
> image from the server.
>
> I used geoserver functionality to display the image in a page. I then cut
> and pasted that in to the code. I read on a tutorial site
> (http://vasir.net/blog/openlayers/openlayers-tutorial-part2-layers/) that
> some of the info for the request will be generated by openlayer, this site
> deals with MapServer so I tried to adapt that to geoserver.
>
> I will try what you suggested, but I’m not sure which parts of the request
> are auto generated.
>
> Steven
>
> -----Original Message-----
> From: Frank Broniewski [mailto:brfr at metrico.lu]
> Sent: 23 April 2010 08:17 AM
> To: ZAMap
> Subject: Re: [OpenLayers-Users] Basic GeoServer OpenLayers map
>
> Hi,
>
> did you already try to put the requested URL from the OpenLayers request
> in the address field of your browser and examine the response? I use
> Firebug for that and this already helps me alot for debugging WMS requests.
>
> Frank
>
> Am 22.04.2010 20:03, schrieb ZAMap:
>>
>> Hi all
>>
>> I'm trying to get a basic map displayed but keep getting bounds is null
>> error.
>>
>> None of the suggestions (allOverlays: true) that I found works, most
>> probably because of other issues with my code/setup.
>>
>> Code:
>>
>> function init() {
>> var map = new OpenLayers.Map('map');
>>
>> var layers = new OpenLayers.Layers.WMS(
>> "basic",
>> "http://localhost:8080/geoserver/wms",
>> {layers: 'topp:states'}
>>
>> map.addLayers(layers);
>> map.zoomToMaxExtent();
>> }
>>
>> My geoserver is working, I can request the map and other data from the
>> server. Any pointers to good tutorials are welcome.
>>
>> Setup:
>> Ubuntu 9.10
>> GeoServer 2.0.1
>> Openlayers 2.8
>>
>> I would appreciate any help.
>
>
--
Frank BRONIEWSKI
METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN
tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu
More information about the Users
mailing list