Geo Locator

24 views
Skip to first unread message

Pratik Jaswant

unread,
Aug 25, 2015, 1:14:53 AM8/25/15
to Leaflet
How do I plot the address like:

Street address: 609 MARMORA AVE,

City: HILLSBOROUGH ,

State: FL

Zip: 33606    

appended: 609 MARMORA AVE, HILLSBOROUGH , FL 33606


 which is taken by JQuery. Please help me how do I plot this on map.

Thanks

Pratik Jaswant

unread,
Aug 25, 2015, 5:38:34 AM8/25/15
to Leaflet
The following Code I have implemented till now:

var searchControl = new L.esri.Geocoding.Controls.Geosearch('609 MARMORA AVE, HILLSBOROUGH , FL 33606').addTo(map);

  var results = new L.LayerGroup().addTo(map);

  searchControl.on('results', function(data){
    results.clearLayers();
   
    //data.text='609 MARMORA AVE, HILLSBOROUGH , FL 33606    ';
    console.log(data.text);
    //609 MARMORA AVE, HILLSBOROUGH , FL 33606
    console.log(data.results);
    for (var i = data.results.length - 1; i >= 0; i--) {
      results.addLayer(L.marker(data.results[i].latlng));
    }
  });
Reply all
Reply to author
Forward
0 new messages