Advertisement
Guest User

Untitled

a guest
Oct 9th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. MAP
  2. IMAGETYPE PNG
  3. EXTENT -180 -90 180 90
  4. UNITS DD
  5. SIZE 1500 650
  6. IMAGECOLOR 255 255 255
  7. FONTSET "fonts/fonts.list"
  8. SYMBOLSET "symbols/symbols35.sym"
  9. WEB
  10. IMAGEPATH "tmp/tmp_img/"
  11. IMAGEURL "**/guide/tmp/tmp_img/"
  12. HEADER "query_header.html"
  13. FOOTER "query_footer.html"
  14. METADATA
  15. "wfs_title" "WFS Guide" ## REQUIRED
  16. "wfs_onlineresource" "http://*********/cgi-bin/mapserv.exe?" ## Recommended
  17. "wfs_srs" "EPSG:4326" ## Recommended
  18. "wfs_abstract" "This is the wfs service of guide" ## Recommended
  19. "wfs_enable_request" "*" # necessary
  20. END
  21. END
  22. PROJECTION
  23. "init=epsg:4326"
  24. END
  25. LAYER # suscribers begin here
  26. PROJECTION
  27. "init=epsg:32232"
  28. END
  29. METADATA
  30. "wfs_title" "suscribers" ##REQUIRED
  31. "wfs_srs" "EPSG:4326" ## REQUIRED
  32. "gml_include_items" "all" ## Optional (serves all attributes for layer)
  33. "gml_featureid" "gid" ## REQUIRED
  34. "wfs_enable_request" "*"
  35. END
  36. CONNECTIONTYPE postgis
  37. NAME suscribers
  38. CONNECTION "user=postgres dbname=postgis20 password=pass"
  39. DATA "geom FROM public.suscribers USING UNIQUE gid USING SRID=32232"
  40. STATUS ON
  41. TYPE POINT
  42. DUMP TRUE
  43. END # suscribers ends here
  44. END # end of map
  45.  
  46. var map = new OpenLayers.Map('map',
  47. { controls: [],
  48. allOverlays: false,
  49. tileSize: new OpenLayers.Size(100, 100),
  50. maxExtent: OpenLayers.Bounds.fromString("-180,-90,180,90"),
  51. projection: new OpenLayers.Projection("EPSG:4326"),
  52. displayProjection: new OpenLayers.Projection("EPSG:4326") //mouse position });
  53. var basic = new OpenLayers.Layer.WMS("Basic",
  54. "http://vmap0.tiles.osgeo.org/wms/vmap0",
  55. { layers: 'basic' },
  56. { singleTile: true,
  57. ratio: 1,
  58. transitionEffect: 'resize',
  59. opacity: 0.5
  60. }
  61. );
  62. var wfsSuscribers = new OpenLayers.Layer.Vector("States",
  63. { protocol: new OpenLayers.Protocol.WFS(
  64. { url: "http://*********/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/routing/index.map&",
  65. featureType: "suscribers",
  66. featureNS: "http://****/routing"
  67. }),
  68. projection: new OpenLayers.Projection("EPSG:4326"),
  69. strategies: [new OpenLayers.Strategy.BBOX()]
  70. }
  71. );
  72. map.addLayers([basic, wfsSuscribers]); map.zoomToMaxExtent();
  73. map.setCenter(new OpenLayers.LonLat(11.52, 3.83), 3);
  74.  
  75. <gml:boundedBy>
  76. <gml:Box srsName="EPSG:4326">
  77. <gml:coordinates>11.416136,3.714272 11.554812,3.969178</gml:coordinates>
  78. </gml:Box>
  79. </gml:boundedBy>
  80. <gml:featureMember>
  81. <ms:suscribers fid="suscribers.2">
  82. <gml:boundedBy>
  83. <gml:Box srsName="EPSG:4326">
  84. <gml:coordinates>11.521489,3.869029 11.521489,3.869029</gml:coordinates>
  85. </gml:Box>
  86. </gml:boundedBy>
  87. <ms:msGeometry>
  88. <gml:Point srsName="EPSG:4326">
  89. <gml:coordinates>11.521489,3.869029</gml:coordinates>
  90. </gml:Point>
  91. </ms:msGeometry>
  92. <ms:gid>2</ms:gid>
  93. <ms:osm_id>331136682</ms:osm_id>
  94. <ms:addr_house></ms:addr_house>
  95. <ms:amenity></ms:amenity>
  96. <ms:name>Yaoundé</ms:name>
  97. <ms:barrier></ms:barrier>
  98.  
  99. wfsSuscribers.events.register('featuresadded', wfsSuscribers, function () {
  100.  
  101. console.log("Number of Features:" + wfsSuscribers.features.length);
  102. map.zoomToExtent(wfsSuscribers.getDataExtent());
  103. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement