浏览代码

Update de librerías.

Maximiliano Schvindt 7 年之前
父节点
当前提交
2dc4e1918d

+ 2 - 14
Resources/public/leaflet/leaflet-wms.js

@@ -17,17 +17,6 @@ L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({
   },
   
   getFeatureInfo: function (evt) {
-    layerx = evt.originalEvent.layerX;
-    layery = evt.originalEvent.layerY;
-    console.log(evt.originalEvent);
-    console.log(layerx + " " + layery);
-    
-    if(layerXClickEvent != layerx || layerYClickEvent != layery) {
-      layerXClickEvent = layerx;
-      layerYClickEvent = layery;
-      console.log("clean");
-      $("#feature").html("");
-    }
 
     // Make an AJAX request to the server and hope for the best
     var url = this.getFeatureInfoUrl(evt.latlng),
@@ -64,7 +53,7 @@ L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({
           width: size.x,
           layers: this.wmsParams.layers,
           query_layers: this.wmsParams.layers,
-          feature_count: 50,
+          feature_count: 1,
           info_format: 'application/json'
         };
     
@@ -76,11 +65,10 @@ L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({
   }, 
   
   showGetFeatureInfo: function (err, latlng, content) {
-    customShowFeature(this._map, err, latlng, content);
+    //customShowFeature(this._map, err, latlng, content);
   }
 });
 
 L.tileLayer.betterWms = function (url, options) {
-  console.log(url);
   return new L.TileLayer.BetterWMS(url, options);  
 };

+ 2 - 7
Resources/views/Leaflet/leaflet_wms.html.twig

@@ -19,9 +19,7 @@ L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({
   },
   
   getFeatureInfo: function (evt) {
-    layerx = evt.originalEvent.layerX;
-    layery = evt.originalEvent.layerY;
-
+    
     // Make an AJAX request to the server and hope for the best
     var url = this.getFeatureInfoUrl(evt.latlng),
         showResults = L.Util.bind(this.showGetFeatureInfo, this);
@@ -30,7 +28,6 @@ L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({
       url: url,
       datatype: 'json',
       success: function (data, status, xhr) {
-        console.log(data);
         var err = typeof data === 'string' ? null : data;
         showResults(err, evt.latlng, data);
       },
@@ -70,14 +67,12 @@ L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({
   }, 
   
   showGetFeatureInfo: function (err, latlng, content) {
-
     customPopupFeature(latlng, content);
   }
 });
 
 L.tileLayer.betterWms = function (url, options) {
-  
-  return new L.TileLayer.BetterWMS(url, options);  
+    return new L.TileLayer.BetterWMS(url, options);  
 };
 
 

+ 5 - 143
Resources/views/Leaflet/resources_only_leaflet.html.twig

@@ -1,150 +1,12 @@
 <link rel="stylesheet" href="{{ asset('bundles/leaflet/leaflet/leaflet.css') }}" />
-<link rel="stylesheet" href="{{ asset('bundles/leaflet/leaflet.draw.css') }}" />
-<link rel="stylesheet" href="{{ asset('bundles/leaflet/leaflet/leaflet-search.css') }}" />
+{# <link rel="stylesheet" href="{{ asset('bundles/leaflet/leaflet.draw.css') }}" />
+<link rel="stylesheet" href="{{ asset('bundles/leaflet/leaflet/leaflet-search.css') }}" /> #}
 
 <script type="text/javascript" src="{{ asset('bundles/leaflet/leaflet/leaflet-src.js') }}" ></script>
-<script type="text/javascript" src="{{ asset('bundles/leaflet/leaflet/leaflet-search.src.js') }}" ></script>
+{# <script type="text/javascript" src="{{ asset('bundles/leaflet/leaflet/leaflet-search.src.js') }}" ></script> #}
 
 <style type="text/css">
-div.leaflet-control-layers-overlays label div span, div.leaflet-control-layers-base label div span {
-	vertical-align: super;
-}
-
-div.leaflet-control-layers-overlays label div input {
-	margin-top: -1px!important;
-}
+div.leaflet-control-layers-overlays label div span, div.leaflet-control-layers-base label div span {vertical-align: super;}
+div.leaflet-control-layers-overlays label div input {margin-top: -1px!important;}
 </style>
 
-
-
-<script type="text/javascript">
-var blueIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-blue.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var redIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-red.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var greenIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-green.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var orangeIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-orange.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var yellowIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-yellow.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var violetIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-violet.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var greyIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-grey.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var blackIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/marker-icon-black.png",
-	iconSize: [25, 41],
-	iconAnchor: [12, 41],
-	popupAnchor: [1, -34],
-	shadowSize: [41, 41]
-});
-
-var miniBubbleRedIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/red_00.png",
-	iconSize: [12, 12]
-});
-
-var miniBubbleRed2Icon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/red_01.png",
-	iconSize: [12, 12]
-});
-
-var miniBubbleOrangeIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/orange_00.png",
-	iconSize: [12, 12]
-});
-
-var miniBubbleBlackIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/black.png",
-	iconSize: [12, 12]
-});
-
-var miniBubbleBlueIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/blue_01.png",
-	iconSize: [12, 12]
-});
-
-var miniBubbleGreenIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/green_01.png",
-	iconSize: [12, 12]
-});
-
-var splitterIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/splitter.png",
-	iconSize: [30, 25]
-});
-
-var miniSquareGreenIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/square_green_00.png",
-	iconSize: [12, 12]
-});
-
-var miniSquareRedIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/square_red_00.png",
-	iconSize: [12, 12]
-});
-
-var miniSquareRed2Icon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/square_red_01.png",
-	iconSize: [12, 12]
-});
-
-var miniSquareBlueIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/square_blue_00.png",
-	iconSize: [12, 12]
-});
-
-var miniSquareBlue2Icon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/square_blue_01.png",
-	iconSize: [12, 12]
-});
-
-var miniSquareOrangeIcon = new L.Icon({
-	iconUrl: "{{ asset('bundles/leaflet/icons/leaflet_color_markers')}}/img/square_orange_00.png",
-	iconSize: [12, 12]
-});
-
-</script>