2017-03-24 2 views
0

Ich verwende die Suche nach Flugblättern und Flugblättern, um die in einer Karte gezeichnete Linie zu suchen. Derzeit mein Code:Wie zoomen Sie in die Broschüre Sicherung Suche?

var map = L.map('map').setView([1.3096622448984000, 103.7689017333800], 12); 

    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=fhi', { 
     maxZoom: 18, 
     attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + 
      '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 
      'Imagery © <a href="http://mapbox.com">Mapbox</a>', 
     id: 'mapbox.streets' 
    }).addTo(map); 
    map.doubleClickZoom.disable(); 

    var options = { 
      position: 'topleft', 
      title: 'Search', 
      placeholder: 'enter link id ', 
      maxResultLength: 15, 
      threshold: 0.5, 
      showInvisibleFeatures: true, 
      showResultFct: function(feature, container) { 
       props = feature.properties; 
       var name = L.DomUtil.create('b', null, container); 
       name.innerHTML = props.id; 

       container.appendChild(L.DomUtil.create('br', null, container)); 

       var cat = props.id 
        info = '' + cat + ', ' + 'th link'; 
       container.appendChild(document.createTextNode(info)); 
      } 
     }; 

    var searchCtrl = L.control.fuseSearch(options); 

    searchCtrl.addTo(map); 
searchCtrl.indexFeatures(zones.features, ['id']); 
info.addTo(map); 

Also wenn ich jetzt suche ich bin in der Lage zusätzlich eine popup.But angezeigt werden soll ich in die Karte vergrößern, wenn ich die Suche ist es möglich, jede Hilfe sehr geschätzt wird?.

Antwort

Verwandte Themen