{$selected_region = $smarty.request.regionUserSearch[0]}
{/if}
- {if $settings.selected_map_interface == 1}
+ {if $settings.selected_map_interface == 1}
<!-- Leaflet Map -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.3/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.3/dist/leaflet.js" integrity="sha512-tAGcCfR4Sc5ZP5ZoVz0quoZDYX5aCtEm/eu1KhSLj2c9eFrylXZknQYmxUssFaVJKvvc0dJQixhGjG2yXWiV9Q==" crossorigin=""></script>
<link rel="stylesheet" href="{$jsUrl}/Leaflet.loading/src/Control.Loading.css" />
<script src="{$jsUrl}/Leaflet.loading/src/Control.Loading.js"></script>
{/if}
-
- {if $settings.selected_map_interface == 2}
+
+ {if $settings.selected_map_interface == 2}
<!-- Google Map -->
<script src="//maps.googleapis.com/maps/api/js?&key={$settings.google_maps_api_key}"></script>
{/if}
{apply_filters('glm-member-db-front-members-list-mapTop', '')}
<div id="glm-locationMap-container">
- {if $settings.selected_map_interface == 1}
+ {if $settings.selected_map_interface == 1}
<!-- Leaflet Map -->
<div id="LeafletMapContainer" style="height: 400px; width: 100%; border: 1px black solid; z-index: +0;"></div>
{/if}
-
- {if $settings.selected_map_interface == 2}
+
+ {if $settings.selected_map_interface == 2}
<!-- Google Map -->
<div id="glm-locationMap" class="glm-map">(map loads here)</div>
{/if}
<p>
{if $m.phone && $settings.list_map_show_phone}<b>Phone:</b> {apply_filters('glm_associate_phone_filter', $m.phone)}<br>{/if}
{if $m.toll_free && $settings.list_map_show_tollfree}{apply_filters('glm_associate_phone_filter', $m.toll_free)}<br>{/if}
- {if $m.url && $settings.list_map_show_url}<b>Web site:</b> <a href="{$m.url}"{if $settings.list_map_show_url_newtarget} target="_blank"{/if}>{$m.url}</a><br>{/if}
+ {if $m.url && $settings.list_map_show_url}<b>Website:</b> <a href="{$m.url}"{if $settings.list_map_show_url_newtarget} target="_blank"{/if}>{$m.url}</a><br>{/if}
{if $m.email && $settings.list_map_show_email}<b>E-Mail Address:</b> <a href="mailto:{$m.email}">{$m.email}</a><br>{/if}
{if $m.region && $settings.list_map_show_region}<b>Region:</b> {$m.region}{/if}
</p>
/*
* Map operations
*/
-
+
var startLat = $('#glmLat').val();
var startLon = $('#glmLng').val();
var defZoom = Number({$settings.maps_default_zoom});
-
- {if $settings.selected_map_interface == 1}
-
+
+ {if $settings.selected_map_interface == 1}
+
/*
* Leaflet Map
* API reference: https://leafletjs.com/reference-1.3.2.html
var leafletMaxZoom = 19;
var clusterRadiusMax = 40;
var geocoder;
-
+
// Loading features
var loadingControl = L.Control.loading({
separate: true,
delayIndicator: 500
});
leafletMap.addControl(loadingControl);
-
+
// Init Map
L.tileLayer(leafletTileServer, {
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.gaslightmedia.com/">Gaslight Media</a>',
maxZoom: leafletMaxZoom,
id: 'nothot'
}).addTo(leafletMap);
-
-
+
+
{if $mapItems}
{if $settings.use_cluster_markers}
maxClusterRadius: clusterRadiusMax
});
{/if}
-
-
+
+
{foreach $mapItems as $m}
{if $m.lat != 0 && $m.lon != 0}
-
- // Create marker for this member and and to Feature Group
+
+ // Create marker for this member and and to Feature Group
var leafletMarker = L.marker([{$m.lat}, {$m.lon}], { title: '{$m.member_name|escape:quotes}' })
- .bindPopup($('#map_info_' + {$m.id}).html())
+ .bindPopup($('#map_info_' + {$m.id}).html(), {
+ maxWidth: 600
+ })
.addTo(markerGroup);
-
+
{/if}
- {/foreach}
-
+ {/foreach}
+
leafletMap.addLayer(markerGroup);
-
+
// Get outer bounds of all markers in the Feature Group
- leafletMap.fitBounds(markerGroup.getBounds());
-
+ leafletMap.fitBounds(markerGroup.getBounds());
+
{/if} // havemembers
-
+
// When a marker is clicked, display the pop-up near the center of the map.
-
+
leafletMap.on('popupopen', function(e) {
var px = leafletMap.project(e.popup._latlng);
+ px.x -= 20;
px.y -= e.popup._container.clientHeight/2;
leafletMap.panTo(leafletMap.unproject(px),{ animate: true });
});
-
+
}
{/if}
-
- {if $settings.selected_map_interface == 2}
-
+
+ {if $settings.selected_map_interface == 2}
+
/*
* Google Maps
* API reference: https://developers.google.com/maps/documentation/javascript/reference
scrollTop: $("#glm-locationMap-container").offset().top-100
}, 400);
}
-
+
var geocoder = new google.maps.Geocoder();
var bounds = new google.maps.LatLngBounds();
var infowindow = new google.maps.InfoWindow();
{/if} // havemembers
- {/if}
+ {/if}
{/if} // settings.list_show_map