I am trying to display popup using infobox but infobox is not opening for Map i am using Gmaps.js script, Map is loading content perfectly but only problem with infobox. here is my code:
map = new GMaps({
div: '#gmap_geocoding',
lat: "20.5937",
lng: "78.9629",
zoom:5
});
var icon = {
url: "/img/marker/location-pointer.png", // url
scaledSize: new google.maps.Size(40, 40), // scaled size
origin: new google.maps.Point(0,0), // origin
anchor: new google.maps.Point(0, 0) // anchor
};
var infoBox;
var boxOptions = {
disableAutoPan: true,
alignBottom: true,
closeBoxURL: "",
maxWidth: 0, // no max
pixelOffset: new google.maps.Size(-140, -12),
infoBoxClearance: new google.maps.Size(1, 1)
};
infoBox = new InfoBox(boxOptions);
$results = $('#search-results').find('div.MapMarker');
$.each($results, function(key,value){
var lat = $(value).data('lat');
var lng = $(value).data('lng');
var name = $(value).data('name');
var sport = $(value).data('sport');
var image = $(value).data('image');
var contentString =
"<div class='infoWindow text-center'><h4><a href='{{ url('/activity/') }}/{{ $vendor->vendor_slug }}/{{ $vendor->activity_slug }}'>"+ name +"</a></h4><img src='"+ image +" 'class='img-responsive' style='width:220px; height:160px;'>"+
"<h5><strong>Sports:</strong> "+ sport + "</h5></div>";
var marker = map.addMarker({
lat:lat,
lng:lng,
icon: icon,
animation: google.maps.Animation.DROP,
title: name,
infoBox:{
content:contentString
}
});
});