I’m following your demo here and am having an issue getting the links to work.
I think the issue is that since I’m using the Marker Clustering from Channel Data code, there doesn’t seem to be any “entry_id” attribute output into the markers. I don’t see another way to make it work.
In your demo I see
map_markers[index].entry_id = 1397
which doesn’t appear in mine. I pasted examples of each below.
is there a way to get that entry_id data into the markers using the “markers from channel entries” method so the script works?
Example marker script from your demo:
var index = map_markers.length;map_markers[index] = new google.maps.Marker({map: map_map, position: new google.maps.LatLng(35.6119313,-83.5496566), icon: ""}); map_markers[index].entry_id = 1397; map_markers[index].index = 0;map_bounds.extend(new google.maps.LatLng(35.6119313,-83.5496566)); if (index > 0) {map_map.fitBounds(map_bounds); } else {map_map.setCenter(map_bounds.getCenter());map_map.setZoom(map_options.zoom); }
Example from my page:
var index = map_markers.length; var newMarker = new google.maps.Marker({map: map_map, icon: {url: "/maps/Images/house.png"}, position: new google.maps.LatLng(41.7570066,-72.1862568)}); var isDuplicate = false; if(typeof map_positions == "undefined") { map_positions = []; } if(map_markers.length > 0) { for(var i = 0; i < map_markers.length; i++) { var marker = map_markers[i]; var a = newMarker.getPosition(); var b = marker.getPosition();
if(a.lat() == b.lat() && a.lng() == b.lng()) { newMarker.setMap(null); } }; } map_positions.push(newMarker.getPosition()); map_markers[index] = newMarker;map_markers[index].index = 0;map_bounds.extend(new google.maps.LatLng(41.7570066,-72.1862568));map_map.fitBounds(map_bounds); (function () { var options = { alignBottom: false, boxClass: "ui-infobox-lhdct", boxStyle: {width: '300px'}, closeBoxMargin: "6px", closeBoxURL: "/assets/graphics/icons/close.png", content: '<div class="ui-infobox-content"><div class="ui-infobox-content"><ul class="listless"><li><strong>Name:</strong> Oliver Bingham House</li><li><strong>Address:</strong> 88 Mansfield Hollow Road, Mansfield, CT</li><li><strong>Parcel ID:</strong> 34/110/22</li></ul></div></div>', disableAutoPan: false, enableEventPropagation: false, infoBoxClearance: new google.maps.Size(0, 0), isHidden: false, maxWidth: 0, pane: "floatPane", pixelOffset: new google.maps.Size(15, -45), zIndex: null };
var infowindow = new InfoBox(options); var obj = map_markers[index]; map_windows.push(infowindow); google.maps.event.addListener(obj, 'click', function(e) { obj.position = e.latLng; obj.getPosition = function() { return e.latLng; } for(var i = 0; i < map_windows.length; i++) { map_windows[i].close(); } infowindow.setPosition(e.latLng); infowindow.open(map_map, obj); }); map_window = infowindow; })();
|