Guest User

Untitled

a guest
Jan 17th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. map.addEventListener('click', onMapClick);
  2. popup = new L.Popup({maxWidth: 1000});
  3. function onMapClick(e) {
  4. var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
  5. var BBOX = map.getBounds()._southWest.lng+","+map.getBounds()._southWest.lat+","+map.getBounds()._northEast.lng+","
  6. +map.getBounds()._northEast.lat;
  7. var WIDTH= map.getSize().x;
  8. var HEIGHT = map.getSize().y;
  9. var X = map.layerPointToContainerPoint(e.layerPoint).x;
  10. var Y = map.layerPointToContainerPoint(e.layerPoint).y;
  11. var layerObj = {};
  12. layerObj["test_layer:EV_Lot_ALHOUDA_wgs"] = alhouda6_layer;
  13. layerObj["test_layer:Imm_Coll_Lot_ALHOUDA_wgs84"] =alhouda7_layer;
  14. layerObj["test_layer:Villa_Lot_ALHOUDA_wgs84"] = alhouda8_layer;
  15. layerObj["test_layer:Eco_Lot_ALHOUDA_wgs84"] =alhouda5_layer;
  16. layerObj["test_layer:Equip_Lot_ALHOUDA_wgs84"] = alhouda4_layer;
  17. layerObj["test_layer:Rec_Lot_ALHOUDA_wgs84"] =alhouda3_layer;
  18. layerObj["test_layer:Parking_Lot_ALHOUDA_wgs84"] = alhouda2_layer;
  19. layerObj["test_layer:P200Log_Lot_ALHOUDA_wgs84"] =alhouda1_layer;
  20.  
  21. layerObj["test_layer:R3_Lot_HFOUNTY_wgs84"] =founty1_layer;
  22. layerObj["test_layer:R5_Lot_HFOUNTY_wgs84"] =founty2_layer;
  23. layerObj["test_layer:R9_Lot_HFOUNTY"] =founty3_layer;
  24. layerObj["test_layer:R15_Lot_HFOUNTY_wgs84"] =founty4_layer;
  25. layerObj["test_layer:R1_Lot_HFOUNTY_wgs84"] =founty5_layer;
  26. layerObj["test_layer:R2_Lot_HFOUNTY_wgs84"] =founty6_layer;
  27. layerObj["test_layer:Equip_Lot_HFOUNTY_wgs84"] =founty7_layer;
  28. queryLayers = [];
  29. for (key in layerObj) {
  30. if(map.hasLayer(layerObj[key])) {
  31. queryLayers.push(key);
  32. }
  33. }
  34. var urlLayers = queryLayers.join();
  35.  
  36. var URL = 'http://105.155.254.96:8082/geoserver/test_layer/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=test_layer:Imm_Coll_Lot_ALHOUDA_wgs84,test_layer:Villa_Lot_ALHOUDA_wgs84,test_layer:Eco_Lot_ALHOUDA_wgs84,test_layer:Equip_Lot_ALHOUDA_wgs84,test_layer:Rec_Lot_ALHOUDA_wgs84,test_layer:EV_Lot_ALHOUDA_wgs,test_layer:P200Log_Lot_ALHOUDA_wgs84,test_layer:Parking_Lot_ALHOUDA_wgs84,R3_Lot_HFOUNTY_wgs84,R5_Lot_HFOUNTY_wgs84,R9_Lot_HFOUNTY,R15_Lot_HFOUNTY_wgs84,R1_Lot_HFOUNTY_wgs84,R2_Lot_HFOUNTY_wgs84,Equip_Lot_HFOUNTY_wgs84&QUERY_LAYERS='+urlLayers+'&propertyName=Zone_Urb,Type_Urb&STYLES=&BBOX='+BBOX+'&FEATURE_COUNT=5&HEIGHT='+HEIGHT+'&WIDTH='+WIDTH+'&FORMAT=image%2Fpng&INFO_FORMAT=text%2fhtml&SRS=EPSG%3A4326&X='+X+'&Y='+Y;
  37. popup.setLatLng(e.latlng);
  38. popup.setContent("<iframe src='"+URL+"' width='400' height='100' frameborder='0'></iframe>");
  39. if (urlLayers)
  40.  
  41. map.openPopup(popup);
Add Comment
Please, Sign In to add comment