I am new in Openlayers and web services in general, but until now I have managed to create a WMS (published by ArcGis to a server provided by uni) and connect it with Openlayers. Projection etc works properly but I don't know how to reach our WFS (e.g. GetFeatureInfo). I need it for applications like highlighing features from a search function, or mouse sensitive events. Any idea?
function init() { var options = { projection: new OpenLayers.Projection("EPSG:3857"), units: "m", maxResolution: "auto", numZoomLevels: 22, maxExtent: new OpenLayers.Bounds(-3339584.723798, -30240971.958386, 6679169.447596, 30240971.958386) }; map = new OpenLayers.Map('map', options); var wms = new OpenLayers.Layer.WMS( "WMS", "http://mikro.bv.tu-berlin.de/arcgis/services/student_grp1/campus_prj/MapServer/WMSServer?", {layers: '1,2,3,4,5,6,7', version:'1.3.0', crs: 'EPSG:3857', transparent:true, isBaseLayer: true}); var gsat = new OpenLayers.Layer.Google( "Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22} ); map.addLayer(gsat); map.addLayer(wms); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.setCenter(new OpenLayers.LonLat(13.326169, 52.512134).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), 16); }
أكثر...
function init() { var options = { projection: new OpenLayers.Projection("EPSG:3857"), units: "m", maxResolution: "auto", numZoomLevels: 22, maxExtent: new OpenLayers.Bounds(-3339584.723798, -30240971.958386, 6679169.447596, 30240971.958386) }; map = new OpenLayers.Map('map', options); var wms = new OpenLayers.Layer.WMS( "WMS", "http://mikro.bv.tu-berlin.de/arcgis/services/student_grp1/campus_prj/MapServer/WMSServer?", {layers: '1,2,3,4,5,6,7', version:'1.3.0', crs: 'EPSG:3857', transparent:true, isBaseLayer: true}); var gsat = new OpenLayers.Layer.Google( "Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22} ); map.addLayer(gsat); map.addLayer(wms); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.setCenter(new OpenLayers.LonLat(13.326169, 52.512134).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), 16); }
أكثر...