How to add WFS and WMS in openlayers?
up vote
0
down vote
favorite
I have two service url like WFS and WMS below:
http://neii.bom.gov.au/services/solarclim/wms/data/monClim_dirNorExp1Hou.nc?service=WMS&version=1.3.0&request=GetCapabilities&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=topp:states&TILED=true&WIDTH=256&HEIGHT=256&CRS=EPSG:4326&STYLES=&BBOX=45%2c-67.5%2c56.25%2c-56.25
http://services.land.vic.gov.au/catalogue/publicproxy/guest/dv_geoserver/datavic/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=datavic:VMADMIN_LGA_POLYGON&SRSNAME=EPSG:4283&cql_filter=LGA_CODE=325
I want those two services need to add as layer in my openlayers map. Is it possible and how?
Updated code with sample data:
myFunction(layerUrl:string, layer: any) {
var bbox = layer.BoundingBox[0].extent;
var crs = layer.BoundingBox[0].crs;
var wmsSource = new ol.source.TileWMS({
url: `${layerUrl}`,
params: {'LAYERS': `${layer.Name}`, 'TILED': true},
serverType: 'geoserver',
projection: `${crs}`,
// Countries have transparency, so do not fade tiles:
transition: 0
});
var wmsLayer = new ol.layer.Tile({
extent: bbox,
source: wmsSource
});
map.addLayer(wmsLayer);
map.getView().fit(wmsLayer.getExtent());
}
Layer url here:
https://wms.geo.admin.ch/
Here is layer object:
Abstract: "Als Kulturgüter von nationaler Bedeutung im Inventar von 2009 gelten rund 3200 Objekte (Einzelbauten / Sammlungen in Museeen, Archiven und Bibliotheken sowie Archäologie)."
Attribution: {Title: "Das Geoportal des Bundes", OnlineResource: "http://www.geo.admin.ch/", LogoURL: {…}}
BoundingBox: [{…}]
CRS: (14) ["epsg:2056", "epsg:21781", "epsg:4326", "epsg:3857", "epsg:3034", "epsg:3035", "epsg:4258", "epsg:31287", "epsg:25832", "epsg:25833", "epsg:31467", "epsg:32632", "epsg:32633", "epsg:900913"]
Dimension: undefined
EX_GeographicBoundingBox: (4) [0.659965, 45.4183, 10.8344, 48.7495]
Layer: (2) [{…}, {…}]
MaxScaleDenominator: undefined
MinScaleDenominator: undefined
Name: "ch.babs.kulturgueter"
Style: [{…}]
Title: "KGS Inventar"
cascaded: undefined
fixedHeight: undefined
fixedWidth: undefined
noSubsets: false
opaque: false
queryable: false
__proto__: Object
openlayers
|
show 3 more comments
up vote
0
down vote
favorite
I have two service url like WFS and WMS below:
http://neii.bom.gov.au/services/solarclim/wms/data/monClim_dirNorExp1Hou.nc?service=WMS&version=1.3.0&request=GetCapabilities&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=topp:states&TILED=true&WIDTH=256&HEIGHT=256&CRS=EPSG:4326&STYLES=&BBOX=45%2c-67.5%2c56.25%2c-56.25
http://services.land.vic.gov.au/catalogue/publicproxy/guest/dv_geoserver/datavic/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=datavic:VMADMIN_LGA_POLYGON&SRSNAME=EPSG:4283&cql_filter=LGA_CODE=325
I want those two services need to add as layer in my openlayers map. Is it possible and how?
Updated code with sample data:
myFunction(layerUrl:string, layer: any) {
var bbox = layer.BoundingBox[0].extent;
var crs = layer.BoundingBox[0].crs;
var wmsSource = new ol.source.TileWMS({
url: `${layerUrl}`,
params: {'LAYERS': `${layer.Name}`, 'TILED': true},
serverType: 'geoserver',
projection: `${crs}`,
// Countries have transparency, so do not fade tiles:
transition: 0
});
var wmsLayer = new ol.layer.Tile({
extent: bbox,
source: wmsSource
});
map.addLayer(wmsLayer);
map.getView().fit(wmsLayer.getExtent());
}
Layer url here:
https://wms.geo.admin.ch/
Here is layer object:
Abstract: "Als Kulturgüter von nationaler Bedeutung im Inventar von 2009 gelten rund 3200 Objekte (Einzelbauten / Sammlungen in Museeen, Archiven und Bibliotheken sowie Archäologie)."
Attribution: {Title: "Das Geoportal des Bundes", OnlineResource: "http://www.geo.admin.ch/", LogoURL: {…}}
BoundingBox: [{…}]
CRS: (14) ["epsg:2056", "epsg:21781", "epsg:4326", "epsg:3857", "epsg:3034", "epsg:3035", "epsg:4258", "epsg:31287", "epsg:25832", "epsg:25833", "epsg:31467", "epsg:32632", "epsg:32633", "epsg:900913"]
Dimension: undefined
EX_GeographicBoundingBox: (4) [0.659965, 45.4183, 10.8344, 48.7495]
Layer: (2) [{…}, {…}]
MaxScaleDenominator: undefined
MinScaleDenominator: undefined
Name: "ch.babs.kulturgueter"
Style: [{…}]
Title: "KGS Inventar"
cascaded: undefined
fixedHeight: undefined
fixedWidth: undefined
noSubsets: false
opaque: false
queryable: false
__proto__: Object
openlayers
See this example FOR WMS openlayers.org/en/latest/examples/wms-tiled.html FOR WFS openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 23 at 8:59
Try using that example if you found any problem show us what you did we will help you
– Atanu
Nov 23 at 9:01
@Atanu in your given wms example extent is hard code, how to use dynamic one?
– user10496245
Nov 23 at 10:37
See this example also openlayers.org/en/latest/examples/wms-no-proj.html
– Atanu
Nov 23 at 11:19
Hi @Atanu thanks for your quick reply. From this service url ahocevar.com/geoserver/wms I am getting list of layers and now I want to show some layers from the list not all. Suppose that one layer, can you provide some sample code by which I can add that specific layer into openlayers map?
– user10496245
Nov 23 at 11:41
|
show 3 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have two service url like WFS and WMS below:
http://neii.bom.gov.au/services/solarclim/wms/data/monClim_dirNorExp1Hou.nc?service=WMS&version=1.3.0&request=GetCapabilities&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=topp:states&TILED=true&WIDTH=256&HEIGHT=256&CRS=EPSG:4326&STYLES=&BBOX=45%2c-67.5%2c56.25%2c-56.25
http://services.land.vic.gov.au/catalogue/publicproxy/guest/dv_geoserver/datavic/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=datavic:VMADMIN_LGA_POLYGON&SRSNAME=EPSG:4283&cql_filter=LGA_CODE=325
I want those two services need to add as layer in my openlayers map. Is it possible and how?
Updated code with sample data:
myFunction(layerUrl:string, layer: any) {
var bbox = layer.BoundingBox[0].extent;
var crs = layer.BoundingBox[0].crs;
var wmsSource = new ol.source.TileWMS({
url: `${layerUrl}`,
params: {'LAYERS': `${layer.Name}`, 'TILED': true},
serverType: 'geoserver',
projection: `${crs}`,
// Countries have transparency, so do not fade tiles:
transition: 0
});
var wmsLayer = new ol.layer.Tile({
extent: bbox,
source: wmsSource
});
map.addLayer(wmsLayer);
map.getView().fit(wmsLayer.getExtent());
}
Layer url here:
https://wms.geo.admin.ch/
Here is layer object:
Abstract: "Als Kulturgüter von nationaler Bedeutung im Inventar von 2009 gelten rund 3200 Objekte (Einzelbauten / Sammlungen in Museeen, Archiven und Bibliotheken sowie Archäologie)."
Attribution: {Title: "Das Geoportal des Bundes", OnlineResource: "http://www.geo.admin.ch/", LogoURL: {…}}
BoundingBox: [{…}]
CRS: (14) ["epsg:2056", "epsg:21781", "epsg:4326", "epsg:3857", "epsg:3034", "epsg:3035", "epsg:4258", "epsg:31287", "epsg:25832", "epsg:25833", "epsg:31467", "epsg:32632", "epsg:32633", "epsg:900913"]
Dimension: undefined
EX_GeographicBoundingBox: (4) [0.659965, 45.4183, 10.8344, 48.7495]
Layer: (2) [{…}, {…}]
MaxScaleDenominator: undefined
MinScaleDenominator: undefined
Name: "ch.babs.kulturgueter"
Style: [{…}]
Title: "KGS Inventar"
cascaded: undefined
fixedHeight: undefined
fixedWidth: undefined
noSubsets: false
opaque: false
queryable: false
__proto__: Object
openlayers
I have two service url like WFS and WMS below:
http://neii.bom.gov.au/services/solarclim/wms/data/monClim_dirNorExp1Hou.nc?service=WMS&version=1.3.0&request=GetCapabilities&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=topp:states&TILED=true&WIDTH=256&HEIGHT=256&CRS=EPSG:4326&STYLES=&BBOX=45%2c-67.5%2c56.25%2c-56.25
http://services.land.vic.gov.au/catalogue/publicproxy/guest/dv_geoserver/datavic/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=datavic:VMADMIN_LGA_POLYGON&SRSNAME=EPSG:4283&cql_filter=LGA_CODE=325
I want those two services need to add as layer in my openlayers map. Is it possible and how?
Updated code with sample data:
myFunction(layerUrl:string, layer: any) {
var bbox = layer.BoundingBox[0].extent;
var crs = layer.BoundingBox[0].crs;
var wmsSource = new ol.source.TileWMS({
url: `${layerUrl}`,
params: {'LAYERS': `${layer.Name}`, 'TILED': true},
serverType: 'geoserver',
projection: `${crs}`,
// Countries have transparency, so do not fade tiles:
transition: 0
});
var wmsLayer = new ol.layer.Tile({
extent: bbox,
source: wmsSource
});
map.addLayer(wmsLayer);
map.getView().fit(wmsLayer.getExtent());
}
Layer url here:
https://wms.geo.admin.ch/
Here is layer object:
Abstract: "Als Kulturgüter von nationaler Bedeutung im Inventar von 2009 gelten rund 3200 Objekte (Einzelbauten / Sammlungen in Museeen, Archiven und Bibliotheken sowie Archäologie)."
Attribution: {Title: "Das Geoportal des Bundes", OnlineResource: "http://www.geo.admin.ch/", LogoURL: {…}}
BoundingBox: [{…}]
CRS: (14) ["epsg:2056", "epsg:21781", "epsg:4326", "epsg:3857", "epsg:3034", "epsg:3035", "epsg:4258", "epsg:31287", "epsg:25832", "epsg:25833", "epsg:31467", "epsg:32632", "epsg:32633", "epsg:900913"]
Dimension: undefined
EX_GeographicBoundingBox: (4) [0.659965, 45.4183, 10.8344, 48.7495]
Layer: (2) [{…}, {…}]
MaxScaleDenominator: undefined
MinScaleDenominator: undefined
Name: "ch.babs.kulturgueter"
Style: [{…}]
Title: "KGS Inventar"
cascaded: undefined
fixedHeight: undefined
fixedWidth: undefined
noSubsets: false
opaque: false
queryable: false
__proto__: Object
openlayers
openlayers
edited Nov 23 at 16:26
asked Nov 22 at 15:28
user10496245
185
185
See this example FOR WMS openlayers.org/en/latest/examples/wms-tiled.html FOR WFS openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 23 at 8:59
Try using that example if you found any problem show us what you did we will help you
– Atanu
Nov 23 at 9:01
@Atanu in your given wms example extent is hard code, how to use dynamic one?
– user10496245
Nov 23 at 10:37
See this example also openlayers.org/en/latest/examples/wms-no-proj.html
– Atanu
Nov 23 at 11:19
Hi @Atanu thanks for your quick reply. From this service url ahocevar.com/geoserver/wms I am getting list of layers and now I want to show some layers from the list not all. Suppose that one layer, can you provide some sample code by which I can add that specific layer into openlayers map?
– user10496245
Nov 23 at 11:41
|
show 3 more comments
See this example FOR WMS openlayers.org/en/latest/examples/wms-tiled.html FOR WFS openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 23 at 8:59
Try using that example if you found any problem show us what you did we will help you
– Atanu
Nov 23 at 9:01
@Atanu in your given wms example extent is hard code, how to use dynamic one?
– user10496245
Nov 23 at 10:37
See this example also openlayers.org/en/latest/examples/wms-no-proj.html
– Atanu
Nov 23 at 11:19
Hi @Atanu thanks for your quick reply. From this service url ahocevar.com/geoserver/wms I am getting list of layers and now I want to show some layers from the list not all. Suppose that one layer, can you provide some sample code by which I can add that specific layer into openlayers map?
– user10496245
Nov 23 at 11:41
See this example FOR WMS openlayers.org/en/latest/examples/wms-tiled.html FOR WFS openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 23 at 8:59
See this example FOR WMS openlayers.org/en/latest/examples/wms-tiled.html FOR WFS openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 23 at 8:59
Try using that example if you found any problem show us what you did we will help you
– Atanu
Nov 23 at 9:01
Try using that example if you found any problem show us what you did we will help you
– Atanu
Nov 23 at 9:01
@Atanu in your given wms example extent is hard code, how to use dynamic one?
– user10496245
Nov 23 at 10:37
@Atanu in your given wms example extent is hard code, how to use dynamic one?
– user10496245
Nov 23 at 10:37
See this example also openlayers.org/en/latest/examples/wms-no-proj.html
– Atanu
Nov 23 at 11:19
See this example also openlayers.org/en/latest/examples/wms-no-proj.html
– Atanu
Nov 23 at 11:19
Hi @Atanu thanks for your quick reply. From this service url ahocevar.com/geoserver/wms I am getting list of layers and now I want to show some layers from the list not all. Suppose that one layer, can you provide some sample code by which I can add that specific layer into openlayers map?
– user10496245
Nov 23 at 11:41
Hi @Atanu thanks for your quick reply. From this service url ahocevar.com/geoserver/wms I am getting list of layers and now I want to show some layers from the list not all. Suppose that one layer, can you provide some sample code by which I can add that specific layer into openlayers map?
– user10496245
Nov 23 at 11:41
|
show 3 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Sorry for late reply, but i use this code in my project with custom settings and this provide me a valid output.
Code is as follows [ please change static ip with your variable ]
var wmsSource = new ol.source.TileWMS({
url: 'https://wms.geo.admin.ch/',
params: {'LAYERS': 'ch.babs.kulturgueter','TILED': true},
serverType: 'geoserver',
projection: 'EPSG:4326',
transition: 0
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
map.addLayer(wmsLayer);
And the output is as follows: [ working just fine ]
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
|
show 2 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Sorry for late reply, but i use this code in my project with custom settings and this provide me a valid output.
Code is as follows [ please change static ip with your variable ]
var wmsSource = new ol.source.TileWMS({
url: 'https://wms.geo.admin.ch/',
params: {'LAYERS': 'ch.babs.kulturgueter','TILED': true},
serverType: 'geoserver',
projection: 'EPSG:4326',
transition: 0
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
map.addLayer(wmsLayer);
And the output is as follows: [ working just fine ]
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
|
show 2 more comments
up vote
1
down vote
accepted
Sorry for late reply, but i use this code in my project with custom settings and this provide me a valid output.
Code is as follows [ please change static ip with your variable ]
var wmsSource = new ol.source.TileWMS({
url: 'https://wms.geo.admin.ch/',
params: {'LAYERS': 'ch.babs.kulturgueter','TILED': true},
serverType: 'geoserver',
projection: 'EPSG:4326',
transition: 0
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
map.addLayer(wmsLayer);
And the output is as follows: [ working just fine ]
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
|
show 2 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Sorry for late reply, but i use this code in my project with custom settings and this provide me a valid output.
Code is as follows [ please change static ip with your variable ]
var wmsSource = new ol.source.TileWMS({
url: 'https://wms.geo.admin.ch/',
params: {'LAYERS': 'ch.babs.kulturgueter','TILED': true},
serverType: 'geoserver',
projection: 'EPSG:4326',
transition: 0
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
map.addLayer(wmsLayer);
And the output is as follows: [ working just fine ]
Sorry for late reply, but i use this code in my project with custom settings and this provide me a valid output.
Code is as follows [ please change static ip with your variable ]
var wmsSource = new ol.source.TileWMS({
url: 'https://wms.geo.admin.ch/',
params: {'LAYERS': 'ch.babs.kulturgueter','TILED': true},
serverType: 'geoserver',
projection: 'EPSG:4326',
transition: 0
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
map.addLayer(wmsLayer);
And the output is as follows: [ working just fine ]
answered Nov 26 at 11:14
Atanu
18912
18912
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
|
show 2 more comments
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
Hi @Atanu, can I use your code for wfs service also? I think wms and wfs same thing, right?
– user10496245
Nov 26 at 11:51
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
@user10496245 wfs is basically Vector Layer source, Not an WMS title, See this example openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 26 at 11:55
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
they used the url as example is confusing to me: 'ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857'
– user10496245
Nov 26 at 12:03
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
I have seen some wfs sample url like: gisserver.domain.com:6080/arcgis/services/wfs_services/…
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
in this last sample url they didn't use bbox or projection , so in this case their code will not work I think, can you help me on this issue?
– user10496245
Nov 26 at 12:04
|
show 2 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434137%2fhow-to-add-wfs-and-wms-in-openlayers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See this example FOR WMS openlayers.org/en/latest/examples/wms-tiled.html FOR WFS openlayers.org/en/latest/examples/vector-wfs.html
– Atanu
Nov 23 at 8:59
Try using that example if you found any problem show us what you did we will help you
– Atanu
Nov 23 at 9:01
@Atanu in your given wms example extent is hard code, how to use dynamic one?
– user10496245
Nov 23 at 10:37
See this example also openlayers.org/en/latest/examples/wms-no-proj.html
– Atanu
Nov 23 at 11:19
Hi @Atanu thanks for your quick reply. From this service url ahocevar.com/geoserver/wms I am getting list of layers and now I want to show some layers from the list not all. Suppose that one layer, can you provide some sample code by which I can add that specific layer into openlayers map?
– user10496245
Nov 23 at 11:41