function glm_enqueue_leaflet(){
global $post;
- if(has_shortcode($post->post_content,'glm-leaflet-theme')){
+ if($post && has_shortcode($post->post_content,'glm-leaflet-theme')){
wp_enqueue_style('glm-leaflet-style', "https://unpkg.com/leaflet@1.3.3/dist/leaflet.css");
wp_enqueue_script('glm-leaflet', "https://unpkg.com/leaflet@1.3.3/dist/leaflet.js");
wp_enqueue_style('glm-leaflet-font', "https://fonts.googleapis.com/css?family=Montserrat&display=swap");
wp_enqueue_style('glm-leaflet-gesture-style', "//unpkg.com/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css");
wp_enqueue_script('glm-leaflet-gesture', "//unpkg.com/leaflet-gesture-handling");
+ ?>
+ <script> window.glm_memberdb_url = '<?php echo get_site_url() ?>/member-detail/'; </script>
+ <?php
wp_enqueue_style('glm-leaflet-map-style', plugin_dir_url(__FILE__).'glm-map-style.css', '1.0.0',true);
wp_enqueue_script('glm-leaflet-map', plugin_dir_url(__FILE__).'glm-map.js', array('jquery'), '1.0.0',true);
}
var style = "color: #525252;line-height: 1;display: block; width: 130px; font-weight: bold; font-family: 'Montserrat';font-size: 15px;";
//////////////////////
- var boyne = new L.marker([45.2125, -85.0173]);
- boyne.addTo(leafletMap);
+ var boyne = new L.marker([45.2125, -85.0173], {url: window.glm_memberdb_url});
+ boyne.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"boyne-city-clinic");
+ });
new L.Marker([45.205, -85.015], {
icon: new L.DivIcon({
//////////////////////
- var chx = new L.marker([45.2984, -85.2558]);
- chx.addTo(leafletMap);
+ var chx = new L.marker([45.2984, -85.2558], {url: window.glm_memberdb_url});
+ chx.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"charlevoix-clinic");
+ });;
new L.Marker([45.289, -85.2558], {
icon: new L.DivIcon({
//////////////////////
- var cheboygan = new L.marker([45.605, -84.4848]);//opacity may be set to zero
- cheboygan.addTo(leafletMap);
+ var cheboygan = new L.marker([45.605, -84.4848], {url: window.glm_memberdb_url});//opacity may be set to zero
+ cheboygan.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"cheboygan-clinic");
+ });
new L.Marker([45.5972, -84.4848], {
icon: new L.DivIcon({
//////////////////////
- var harbor = new L.marker([45.4274, -84.9106]);
- harbor.addTo(leafletMap);
+ var harbor = new L.marker([45.4274, -84.9106], {url: window.glm_memberdb_url});
+ harbor.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"harbor-springs-clinic");
+ });;
new L.Marker([45.4274, -84.9106], {
icon: new L.DivIcon({
////////////////
- var indianriver = new L.marker([45.4083, -84.6154]);
- indianriver.addTo(leafletMap);
+ var indianriver = new L.marker([45.4083, -84.6154], {url: window.glm_memberdb_url});
+ indianriver.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"indian-river-clinic");
+ });;
new L.Marker([45.40, -84.6154], {
///////////
- var petoskey = new L.marker([45.358, -85.0271]);
- petoskey.addTo(leafletMap);
+ var petoskey = new L.marker([45.358, -85.0271], {url: window.glm_memberdb_url});
+ petoskey.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"petoskey-clinic");
+ });;
new L.Marker([45.350, -85.0271], {
html: '<span style="' + style + '" class="glm-theme-map-label">Petoskey</span>'
})
}).addTo(leafletMap);
+
//////////////////////
- var petoskeyEast = new L.marker([45.3746, -84.9276]);
- petoskeyEast.addTo(leafletMap);
+ var petoskeyEast = new L.marker([45.3746, -84.9276], {url: window.glm_memberdb_url});
+ petoskeyEast.addTo(leafletMap).on("click", function(){
+ window.open(this.options.url+"petoskey-east-clinic");
+ });;
new L.Marker([45.370, -84.9276], {
icon: new L.DivIcon({