Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have installed GeoServer and publish one shapefile on it. Now my question is, How can i access that shapefile from GeoServer? and can i work with that resource (shapefile) with ArcGIS API. As we can access any resource from ArcGIS sample server like the code below:

queryTask = new esri.arcgis.gmaps.QueryTask("sampleserver1.arcgisonline.com/ArcGIS/rest/services/…;);

Similarly, which piece of code i need to access my published file from GeoServer ?

share|improve this question
add comment

3 Answers 3

up vote 0 down vote accepted

GeoServer is serving your shapefile using OGC standards. WMS will send an image of your data while WFS will return the actual data as a vector (encoded in GML by default). Try searching in the ArcGIS help for details of how to import these standards.

share|improve this answer
add comment

The ArcGIS Web API's all support WMS (but not WFS). So the QueryTask will not work with your geoserver).

To use it within the ArcGIS API for JavaScript, use

var wmsLayer = new esri.layers.WMSLayer(YOURURL); 
wmsLayer.setVisibleLayers([2]);  
wmsLayer.setImageFormat("png");
map.addLayer(wmsLayer);

See the JSAPI resource center for more samples: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm

share|improve this answer
add comment

If you want to see the url or download the shapefile from geoserver go to the console and then look at the published datasets. Your set should be there and there should be a whole different set of ways to preview your data.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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