John,
Is there sample code available to center the map on the geocode result at a specified zoom layer? I added the code below, which moved the marker to the correct location. However, the console log reports "Uncaught TypeError: Cannot read property 'lat' of null."
Also, the marker does not redraw unless the location is within the current view.
addressSearch.on('results', function(data){
results.clearLayers();
for (var i = data.results.length - 1; i >= 0; i--) {
results.addLayer(L.marker(data.results[0].latlng));
map.panTo(results);
}
});
I changed results to results[0] to remove multiple markers from showing up, in case you were wondering.
Thanks,
Patrick