I have added the location manager plugin on my wordpress site in which when i had searched location map was displaying but the marker not showing on the searched location i don't know how to show marker. my plugin code is:
if(!empty($catinfo_arr)){?>
<script type="text/javascript" async >
var CITY_MAP_CENTER_LAT= '<?php echo $latitude?>';
var CITY_MAP_CENTER_LNG= '<?php echo $longitude?>';
var CITY_MAP_ZOOMING_FACT= <?php echo $zoom_level;?>;
var infowindow;
var zoom_option = '<?php echo $map_display; ?>';
// var markers = <?php echo $catinfo_arr;?>;
var clustering = '<?php echo $clustering;?>';
var map;
var mgr;
var markerClusterer;
var markerArray = [];
var pippoint_effects='<?php echo ($templatic_settings['pippoint_effects'] == 'hover')? 'hover':'click';?>';
var PIN_POINT_ICON_HEIGHT = 32;
var PIN_POINT_ICON_WIDTH = 20;
var infoBubble = new InfoBubble({maxWidth:210,minWidth:210,minHeight:"auto",padding:0,borderRadius:0,borderWidth:0,overflow:"visible",backgroundColor:"#fff"});
var isDraggable = jQuery(document).width() > 480 ? true : false;
var isscrollwheel = jQuery(document).width() > 480 ? true : false;
var dragging = zoom_changed = false;
var bounds_modified = false;
var new_bounds;
var query_string='<?php echo $_SERVER['QUERY_STRING'];?>';
var zoom_changed=1;
function initialize() {
bounds = new google.maps.LatLngBounds();
var myOptions = {
scrollwheel: isscrollwheel,
draggable: isDraggable,
zoom: CITY_MAP_ZOOMING_FACT,
center: new google.maps.LatLng(CITY_MAP_CENTER_LAT, CITY_MAP_CENTER_LNG),
mapTypeId: google.maps.MapTypeId.<?php echo $map_type;?>
}
map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
/* map style customizer */
var styles = [<?php echo substr($google_map_customizer,0,-1);?>];
map.setOptions({styles: styles});
/* Add Google Map marlkers */
mgr = new MarkerManager( map );
templ_add_googlemap_markers(markers);
if(zoom_option==1){
map.fitBounds(bounds);
map.setCenter(bounds.getCenter());
}
/* but that message is not within the marker's instance data */
google.maps.event.addListener(map, 'dragstart', function() {
dragging = false;
});
google.maps.event.addListener(map, 'dragend', function() {
dragging = true;
});
google.maps.event.addListener(map, 'bounds_changed', function() {
bounds_modified = true;
new_bounds = map.getBounds();
});
google.maps.event.addListener(map, 'zoom_changed', function() {
if(zoom_changed!=1){
dragging = true;
}
zoom_changed=0;
});
google.maps.event.addListener(map, 'idle', function(ev){
refresh_markers();
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="listing_google_map" class="listing_google_map" >
<div class="map_sidebar">
<div class="top_banner_section_in clearfix">
<div class="TopLeft"><span id="triggermap"></span></div>
<div class="TopRight"></div>
<div id="map_canvas" style="width: 100%; height:<?php echo $heigh;?>px" class="map_canvas"></div>
</div>
</div>
</div>
<script type="text/javascript" async >
var maxMap = document.getElementById( 'triggermap' );
google.maps.event.addDomListener(maxMap, 'click', showFullscreen);
function showFullscreen() {
jQuery('#map_canvas').toggleClass('map-fullscreen');
jQuery('.map_category').toggleClass('map_category_fullscreen');
jQuery('.map_post_type').toggleClass('map_category_fullscreen');
jQuery('#trigger').toggleClass('map_category_fullscreen');
jQuery('body').toggleClass('body_fullscreen');
jQuery('#loading_div').toggleClass('loading_div_fullscreen');
jQuery('#advmap_nofound').toggleClass('nofound_fullscreen');
jQuery('#triggermap').toggleClass('triggermap_fullscreen');
jQuery('.TopLeft').toggleClass('TopLeft_fullscreen');
window.setTimeout(function() {
var center = map.getCenter();
google.maps.event.trigger(map, 'resize');
map.setCenter(center);
}, 100);
}
</script>
<?php
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire