Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAP
- IMAGETYPE PNG
- EXTENT -180 -90 180 90
- UNITS DD
- SIZE 1500 650
- IMAGECOLOR 255 255 255
- FONTSET "fonts/fonts.list"
- SYMBOLSET "symbols/symbols35.sym"
- WEB
- IMAGEPATH "tmp/tmp_img/"
- IMAGEURL "**/guide/tmp/tmp_img/"
- HEADER "query_header.html"
- FOOTER "query_footer.html"
- METADATA
- "wfs_title" "WFS Guide" ## REQUIRED
- "wfs_onlineresource" "http://*********/cgi-bin/mapserv.exe?" ## Recommended
- "wfs_srs" "EPSG:4326" ## Recommended
- "wfs_abstract" "This is the wfs service of guide" ## Recommended
- "wfs_enable_request" "*" # necessary
- END
- END
- PROJECTION
- "init=epsg:4326"
- END
- LAYER # suscribers begin here
- PROJECTION
- "init=epsg:32232"
- END
- METADATA
- "wfs_title" "suscribers" ##REQUIRED
- "wfs_srs" "EPSG:4326" ## REQUIRED
- "gml_include_items" "all" ## Optional (serves all attributes for layer)
- "gml_featureid" "gid" ## REQUIRED
- "wfs_enable_request" "*"
- END
- CONNECTIONTYPE postgis
- NAME suscribers
- CONNECTION "user=postgres dbname=postgis20 password=pass"
- DATA "geom FROM public.suscribers USING UNIQUE gid USING SRID=32232"
- STATUS ON
- TYPE POINT
- DUMP TRUE
- END # suscribers ends here
- END # end of map
- var map = new OpenLayers.Map('map',
- { controls: [],
- allOverlays: false,
- tileSize: new OpenLayers.Size(100, 100),
- maxExtent: OpenLayers.Bounds.fromString("-180,-90,180,90"),
- projection: new OpenLayers.Projection("EPSG:4326"),
- displayProjection: new OpenLayers.Projection("EPSG:4326") //mouse position });
- var basic = new OpenLayers.Layer.WMS("Basic",
- "http://vmap0.tiles.osgeo.org/wms/vmap0",
- { layers: 'basic' },
- { singleTile: true,
- ratio: 1,
- transitionEffect: 'resize',
- opacity: 0.5
- }
- );
- var wfsSuscribers = new OpenLayers.Layer.Vector("States",
- { protocol: new OpenLayers.Protocol.WFS(
- { url: "http://*********/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/routing/index.map&",
- featureType: "suscribers",
- featureNS: "http://****/routing"
- }),
- projection: new OpenLayers.Projection("EPSG:4326"),
- strategies: [new OpenLayers.Strategy.BBOX()]
- }
- );
- map.addLayers([basic, wfsSuscribers]); map.zoomToMaxExtent();
- map.setCenter(new OpenLayers.LonLat(11.52, 3.83), 3);
- <gml:boundedBy>
- <gml:Box srsName="EPSG:4326">
- <gml:coordinates>11.416136,3.714272 11.554812,3.969178</gml:coordinates>
- </gml:Box>
- </gml:boundedBy>
- <gml:featureMember>
- <ms:suscribers fid="suscribers.2">
- <gml:boundedBy>
- <gml:Box srsName="EPSG:4326">
- <gml:coordinates>11.521489,3.869029 11.521489,3.869029</gml:coordinates>
- </gml:Box>
- </gml:boundedBy>
- <ms:msGeometry>
- <gml:Point srsName="EPSG:4326">
- <gml:coordinates>11.521489,3.869029</gml:coordinates>
- </gml:Point>
- </ms:msGeometry>
- <ms:gid>2</ms:gid>
- <ms:osm_id>331136682</ms:osm_id>
- <ms:addr_house></ms:addr_house>
- <ms:amenity></ms:amenity>
- <ms:name>Yaoundé</ms:name>
- <ms:barrier></ms:barrier>
- wfsSuscribers.events.register('featuresadded', wfsSuscribers, function () {
- console.log("Number of Features:" + wfsSuscribers.features.length);
- map.zoomToExtent(wfsSuscribers.getDataExtent());
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement