What is the best way to code this?
A leaflet map loads with Location Broward at its center. There are 2 buttons, one for Location Broward and another for Location Palm.
When Button Broward is clicked (and map is at Location Broward: true) nothing should happen.
If Button Palm is clicked (and map is at Location Broward: true) the map’s center goes to Location Palm.
The Leaflet map is loading into a bootstrap file.
<div id=“container”>
<div id=“map-holder”>
<div id=“map”>
Should I do this with setView, setLatLng. Do I need to state “new L.latlong. Should I reference the map like .map-holder.map OR $(‘.map’).setView
OR make a function ....
function onClick(e) {
$('.map').setView(L.latlng(26.5,-80.184), 10); };
map.on('click', '#palm_btn', function(e) {
onClick(); });
I think I just keep spinning to many thoughts on this. I know this should be simple, hopefully someday it will.
Thanks,
Cindy
--
---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.