4

I have my shapefile inside GeoServer and I already published it as a layer.

I am able to preview the layer under GeoServer web interface.

Now, I want to subscribe / import/ retrieve the shapefile as image to my third party online map API. So that, the polygon can overlay on my third party map.

The online map API I am using now is a non-popular API and they do not provide any sample or source for subscribing / importing / retrieving WMS layer.

They just provide the following code to demonstrate the use of their map to import WMS layer:

Xmap.ImportWMSLayer('layer title',
    {
        url:'http://WMS',
        layers:'Layer_Name',
        version: '1.3.0', // WMS version
        crs:'EPSG:900913', 
        srs:'EPSG:900913', 
        format:'image/png' // format
    });

I tried to key in the respective parameters but it just does not seems to retrieve.

Hence, now I would like to diagnosis the problems

Problem 1: I set the WMS in GeoServer wrongly and hence can't retrieve the map

Problem 2: I set the WMS in GeoServer correctly but I key in the parameter name wrongly, and hence can't retrieve the map

So here is my question:

1) I am able to preview my layer in GeoServer web interface, does this mean, the layer is ready for retrieve to third party map API?

2) If answer for question (1) is a NO. Then how can I make sure my GeoServer is providing the map service for my layer?

EDIT: update based on the request of more info

My Layer Name

Since the layer name in my GeoServer is korea, So I also key in 'korea' as my layer name in as the parameter name.

EDIT: Update the parameters information which I set

map.ImportWMSLayer('korea',
    {
        url:'http://localhost:8080/geoserver/web/',
        layers:'korea:korea', 
        version: '1.3.0', 
        crs:'EPSG:4326', 
        srs:'EPSG:4326', 
        format:'image/png' 
    });

EDIT: I update the URL to http://localhost:8080/geoserver/korea/wms

EDIT Add the preview layer display screen in my GeoServer

Inspect Element in OpenLayers preview

<img id="OpenLayersDiv44" class="olTileImage" src="http://localhost:8080/geoserver/korea/wms?LAYERS=korea%3Akorea&amp;STYLES=&amp;FORMAT=image%2Fpng&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;SRS=EPSG%3A4326&amp;BBOX=121.54456007603,28.652528651739,136.26831368157,39.637829193375&amp;WIDTH=512&amp;HEIGHT=382" style="width: 512px; height: 382px; position: relative;">

preview Layer in GeoServer

  • It might help if you tell us the API/Library that you are using. Can you also tell us the name of your layer, along with its workspace? – Devdatta Tengshe Nov 21 '13 at 8:39
  • 1
    vworld, a korean map API. I bet no one heard about it before. For those who never heard this API before, pls give me an upvote. TQ. – jhyap Nov 21 '13 at 8:47
  • 1
    From the website, it appears to be a Javascript app/library/ I'll suggest that you debug the HTTP calls using something like Fidder/Firebug to see what is happening. Is the call going through at all? or is it failing somewhere else. – Devdatta Tengshe Nov 21 '13 at 10:23
  • 1
    2 things: Does the vworld API need to have "Style" set in the WMS request? Secondly, you can get the WMS parameters from the URL of each map request in the Geoserver console. Just open the layer preview and then right click on the map and select "Inspect Element" to view the map's HTML values, which will include the URL and all the WMS parameters – minus34 Nov 22 '13 at 2:52
  • 1
    I think the wms url should be something like: http://localhost:8080/geoserver/korea/wms – Devdatta Tengshe Nov 22 '13 at 3:09
3

Question:

How to make sure GeoServer is providng WMS for my layer?

Answer:

Use a third party software like QGIS-desktop to add the WMS layer provided by GeoServer.

If you are able to present the WMS layer in QGIS-desktop, this varified that GeoServer is providing the Web Map Service.

Add WNS layer in QGIS

0

I believe your URL is wrong.

Change "web/" to "wms?"!!!

map.ImportWMSLayer('korea',
    {
    url:'http://localhost:8080/geoserver/wms?',
    layers:'korea:korea', 
    version: '1.3.0', 
    crs:'EPSG:4326', 
    srs:'EPSG:4326', 
    format:'image/png' 
    });
  • I already update it before u post the answer – jhyap Nov 22 '13 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.