I am facing a challenge while attempting to switch the infowindow in Google maps to the smartinfowindow, as the position of the infowindow appears incorrect. This issue only occurs with the smartinfowindow and not with the standard infowindow.
Upon further investigation, I discovered that by removing 'position: relative' using Firefox inspector, the map shifts to the top left corner of the window, resulting in the smartinfowindows being correctly positioned.
Could there be something crucial that I am overlooking?
The markers are created using the following code:
for (var i = 0; i < data.locations.length; i++) {
var dataPhoto = data.locations[i];
var latLng = new google.maps.LatLng(dataPhoto.latitude,dataPhoto.longitude);
latlngbounds.extend( latLng );
var marker = new google.maps.Marker({
position: latLng,
icon: 'http://www.irishcottageholidays.com/images/cottage1.png'
});
listenMarker(map,marker,InfoWindow,dataPhoto.mID)
markers.push(marker);
}
To create the smartinfowindow:
function listenMarker (map,marker,InfoWindow,mID){
google.maps.event.addListener(marker, 'click', function() {
load_content(map,this,InfoWindow,mID);
});
function load_content(map,marker,InfoWindow,mID){
var $j = jQuery.noConflict();
$j.ajax({
type : 'GET',
url : '/ajax/map_popup.asp',
data: {
mID : mID
},
success: function(result){
new SmartInfoWindow({position: marker.getPosition(), map: map, content: result});
}
});
}
Initially, I used the following code to create the infowindows:
InfoWindow.setOptions({
disableAutoPan: true,
maxWidth: 280
});
InfoWindow.setContent(result);
InfoWindow.open(map, marker);
While this method worked for standard infowindows, it seems to be causing alignment issues with the smartinfowindow.
Any assistance provided is greatly appreciated.
---- EDIT ----
Another issue has arisen with the smartinfowindow failing to close when opening another one. So far, I have been unsuccessful in resolving this matter. The solutions I've come across appear to be tailored for standard infowindows and do not apply to the smartinfowindow.
Once again, thank you in advance for any help offered.