Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. http://localhost/cgi-bin/mapserv.exe?LAYERS=testpoint&QUERY_LAYERS=testpoint&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=517948%2C157505%2C535448%2C170005&FEATURE_COUNT=1&HEIGHT=500&WIDTH=700&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A27700&X=357&Y=241&MAP=%2FWorkTemp%2Ftest.map
  2.  
  3. layer = new OpenLayers.Layer.WMS( "WMS data","http://localhost/cgi-bin/mapserv.exe?", {layers: 'testpoint' , map: '/WorkTemp/test.map', transparent: true},{isBaseLayer: false, opacity: 1, singleTile: true, visibility: true});
  4.  
  5. osMap.addLayer(layer);
  6.  
  7. info = new OpenLayers.Control.WMSGetFeatureInfo({
  8. url: 'http://localhost/cgi-bin/mapserv.exe?',
  9. title: 'Identify features by clicking',
  10. queryVisible: true,
  11. maxFeatures: 1,
  12. vendorParams: {
  13. map: '/WorkTemp/test.map'
  14. } ,
  15. info_format: 'text/html',
  16. layers: [layer],
  17. eventListeners: {
  18. getfeatureinfo: function(event) {
  19. if(event.features.length > 0) {
  20. osMap.addPopup(new OpenLayers.Popup.FramedCloud(
  21. "chicken",
  22. osMap.getLonLatFromPixel(event.xy),
  23. null,
  24. event.text,
  25. null,
  26. true
  27. ));
  28. }
  29. }
  30. }
  31. });
  32.  
  33. osMap.addControl(info);
  34. info.activate();
  35.  
  36. LAYER
  37. NAME "testpoint"
  38. TYPE POINT
  39. STATUS ON
  40. CONNECTIONTYPE OGR
  41. CONNECTION "MYSQL:test,host=localhost,user=root,password=xxxxxx,port=3306"
  42. DATA "SELECT SHAPE,test from testpoint"
  43. DUMP TRUE
  44.  
  45. TEMPLATE "c:WorkTemptest_template.html"
  46.  
  47.  
  48. LABELITEM "test"
  49. PROJECTION
  50. "init=epsg:27700"
  51. END
  52. CLASS
  53. NAME "test"
  54. STYLE
  55. SYMBOL 'circle'
  56. SIZE 10
  57. COLOR 255 215 0
  58. END
  59. LABEL
  60. COLOR 0 0 0
  61. FONT arial
  62. TYPE truetype
  63. SIZE 8
  64. POSITION AUTO
  65. PARTIALS FALSE
  66. OUTLINECOLOR 255 255 255
  67. END
  68. END
  69. END # layer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement