+ var map = L.map(divName, {
+ worldCopyJump: true
+ });
+
+ // Set initial view if URL parameters are available, otherwise fitBounds
+ if (lat !== null && lon !== null && zoom !== null) {
+ map.setView([lat, lon], zoom);
+ } else {
+ map.fitBounds(<%= @bbox.to_json %>);
+ }