Guest User

Untitled

a guest
Nov 23rd, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. MAP
  2. NAME "guarulhos"
  3. EXTENT 339574.172100 7399304.302223 361316.525900 7421573.107621
  4. SIZE 800 800
  5.  
  6. QUERYMAP
  7. STATUS on
  8. STYLE normal
  9. END
  10.  
  11. UNITS METERS
  12. SHAPEPATH "data/"
  13. IMAGECOLOR 155 155 155
  14.  
  15. SCALEBAR
  16. IMAGECOLOR 255 255 255
  17. LABEL
  18. COLOR 0 0 0
  19. SIZE SMALL
  20. END
  21. SIZE 150 5
  22. COLOR 255 255 255
  23. BACKGROUNDCOLOR 0 0 0
  24. OUTLINECOLOR 0 0 0
  25. UNITS kilometers
  26. INTERVALS 5
  27. STATUS EMBED
  28. END
  29.  
  30. LEGEND
  31. STATUS EMBED
  32. POSITION UL
  33. KEYSIZE 18 12
  34. LABEL
  35. TYPE BITMAP
  36. SIZE MEDIUM
  37. COLOR 255 0 0
  38. END
  39. END
  40.  
  41. WEB
  42. TEMPLATE "template.html"
  43. IMAGEPATH "/ms4w/tmp/ms_tmp/"
  44. IMAGEURL "/ms_tmp/"
  45. METADATA
  46. "wms_title" "wms guarulhos"
  47. "wms_onlineresource" "localhost/cgi-bin/mapserv.exe?map=../htdocs/mapteste3/mapfile.map"
  48. "wms_srs" "EPSG:31983"
  49. #29193 esse é o que o giordano falou
  50. #31983 esse ta na saída do orginfo
  51. END
  52. END
  53.  
  54. PROJECTION
  55. "init=epsg:31983"
  56. END
  57.  
  58. LAYER
  59. NAME face_guarulhos
  60. TYPE line
  61. CONNECTIONTYPE postgis
  62. CONNECTION "host=myip user=myuser password=mypwd dbname=mydbname port=myport"
  63. DATA "geom from ctageo.face_guarulhos"
  64. STATUS default
  65.  
  66. METADATA
  67. "wms_title" "face_guarulhos"
  68. END
  69.  
  70. CLASS
  71. NAME "Faces Guarulhos"
  72. OUTLINECOLOR 139 134 130
  73. COLOR 255 145 145
  74. END
  75. END
  76.  
  77. LAYER
  78. NAME pg_trechos
  79. TYPE line
  80. CONNECTIONTYPE postgis
  81. CONNECTION "host=myip user=myuser password=mypwd dbname=mydbname port=myport"
  82. DATA "geom from transporte.pg_trechos"
  83. STATUS default
  84.  
  85. METADATA
  86. "wms_title" "pg_trechos"
  87. END
  88.  
  89. CLASS
  90. NAME "Trechos"
  91. OUTLINECOLOR 46 33 255
  92. COLOR 226 225 232
  93. END
  94. END
  95. END
  96.  
  97. <!-- MapServer Template -->
  98. <html>
  99. <head>
  100. <title>Test Guarulhos</title>
  101. <meta charset="utf-8"/>
  102. <link rel="stylesheet" href="https://openlayers.org/en/v4.4.2/css/ol.css" type="text/css">
  103. <style>
  104. .map {
  105. /*height: 700px;*/
  106. width: 50%;
  107. align-self: center;
  108. }
  109. body {
  110. text-align: center;
  111. }
  112. </style>
  113. <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
  114. <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
  115. <script src="https://openlayers.org/en/v4.4.2/build/ol.js"></script>
  116. </head>
  117.  
  118. <body>
  119. <form method="get" action="/cgi-bin/mapserv.exe">
  120. <input type="hidden" name="map" value="[map]"/>
  121. <input type="hidden" name="imgext" value="[mapext]">
  122. <input type="hidden" name="zoom" value="1"/>
  123. <input type="hidden" name="mode" value="browse"/>
  124.  
  125. <label>Mapfile: </label>[map]<br>
  126. <label>Extent: </label>[mapext]<br>
  127. <label>Img: </label>[img]<br>
  128. <label>Center: </label>[center]<br>
  129.  
  130. <p id="teste">
  131. The following element suposed to be a map.<br>
  132. </p>
  133.  
  134. <label>Zoom: </label>
  135. <select multiple name="zoom" size=5>
  136. <option value="3" > 3
  137. <option value="2" > 2
  138. <option value="1" selected> 1
  139. <option value="-2"> -2
  140. <option value="-3"> -3
  141. </select>
  142.  
  143. <br/>
  144. <br/>
  145. <br/>
  146. <br/>
  147. <input type="image" name="img" src="[img]" width="500"
  148. height="500" border="0">
  149. </form>
  150.  
  151. <br/>
  152. <br/>
  153. <br/>
  154. <br/>
  155.  
  156. <div id="map" class="map"></div>
  157.  
  158. <script type="text/javascript">
  159. var myurl = 'http://localhost/cgi-bin/mapserv.exe?map=../htdocs/mapteste3/mapfile.map&';
  160.  
  161. var exurl = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer';
  162.  
  163. var layers = [
  164. new ol.layer.Tile({
  165. source: new ol.source.OSM()
  166. }),
  167. new ol.layer.Image({//this is for testing
  168. source: new ol.source.ImageArcGISRest({
  169. ratio: 1,
  170. params: {},
  171. url: exurl
  172. })
  173. }),
  174. new ol.layer.Image({ //this is my map
  175. source: new ol.source.ImageWMS({
  176. ratio: 1,
  177. params: {'LAYERS':'face_guarulhos', 'pg_trechos'},
  178. crossOrigin: '/ms_tmp/',
  179. url: myurl
  180. })
  181. })
  182. ];
  183.  
  184. var map = new ol.Map({
  185. layers: layers,
  186. target: 'map',
  187. view: new ol.View({
  188. center: ol.proj.fromLonLat([-46.5233014,-23.4523035]),
  189. zoom: 13
  190. })
  191. });
  192. </script>
  193. </body>
  194. </html>
  195.  
  196. new ol.layer.Image({ //this is my map
  197. source: new ol.source.ImageWMS({
  198. ratio: 1,
  199. params: {'LAYERS':'face_guarulhos, pg_trechos'},
  200. url: myurl
  201. })
  202. })
Add Comment
Please, Sign In to add comment