{if $settings.selected_map_interface == 1}
<!-- Leaflet Map -->
- <div id="LeafletMapContainer" style="height: 400px; width: 100%; border: 1px black solid; z-index: +0;"></div>
+ <div id="LeafletMapContainer" style="height: 400px; width: 90%; border: 1px black solid; z-index: +0; margin: 0 auto;"></div>
{/if}
{if $settings.selected_map_interface == 2}
</div>
{/if}
<div class="glm-map-member-name">
- {if $settings.list_map_show_detaillink && !$m.has_no_profile.value}
+ {if $settings.list_map_show_detaillink && !$m.has_no_profile}
<a href="{$siteBaseUrl}{$settings.canonical_member_page}/{$m.member_slug}/{if $settings.enable_multiple_profiles}{$m.id}/{/if}?entity_template={php}echo $GLOBALS['entity_page_slug'];{/php}">{$m.member_name}</a>
{else}
{$m.member_name}
</p>
{/if} {*list_map_show_address*}
<div class="glm-member-list-info">
- <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>Website:</b> <a href="{$m.url}"{if $settings.list_map_show_url_newtarget} target="_blank"{/if}>{$m.url}</a><br>{/if}
+ <p class="glm-member-list-map-info">
+ {if $m.phone && $settings.list_map_show_phone}<b>Phone:</b> <a href="tel:{apply_filters('glm_associate_phone_filter_tel', $m.phone)}">{apply_filters('glm_associate_phone_filter', $m.phone)}</a><br>{/if}
+ {if $m.toll_free && $settings.list_map_show_tollfree}<a href="tel:{apply_filters('glm_associate_phone_filter_tel', $m.toll_free)}">{apply_filters('glm_associate_phone_filter', $m.toll_free)}</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}
+ {if $m.url && $settings.list_map_show_url}<a href="{$m.url}"{if $settings.list_map_show_url_newtarget} target="_blank"{/if}>Website</a><br>{/if}
</p>
{if $m.descr && $settings.list_map_show_descr}{$m.descr|nl2br}<br>{/if}
{if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr}<br>{/if}
+ {if $settings.list_map_show_detaillink && !$m.has_no_profile}
+ <a href="{$siteBaseUrl}{$settings.canonical_member_page}/{$m.member_slug}/{if $settings.enable_multiple_profiles}{$m.id}/{/if}">More Info</a>
+ {/if}
{if $m.categories && $settings.list_map_show_categories}
<div class="glm-member-list-items">
<b>{$terms.term_member_cap} Categories</b>
});
{/if}
+ var mapContainerWidth = Number(leafletMap._container.clientWidth);
+ var maxPopupWidth = .65 * mapContainerWidth;
+ if (maxPopupWidth > 600) {
+ maxPopupWidth = 600;
+ }
+ var mapContainerHeight = Number(leafletMap._container.clientHeight);
+ var maxPopupHeight = .7 * mapContainerHeight;
{foreach $mapItems as $m}
{if $m.lat != 0 && $m.lon != 0}
// 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: maxPopupWidth,
+ maxHeight: maxPopupHeight
+ })
.addTo(markerGroup);
{/if}
leafletMap.on('popupopen', function(e) {
var px = leafletMap.project(e.popup._latlng);
- px.y -= e.popup._container.clientHeight/2;
+ px.x -= 20; // Bump a bit to the right to avoid resize buttons
+ px.y -= e.popup._container.clientHeight/2; // Position more toward the center
leafletMap.panTo(leafletMap.unproject(px),{ animate: true });
});