Skip to content
Snippets Groups Projects
Commit fdb899d8 authored by Elijah Byrd's avatar Elijah Byrd
Browse files

Renamed markers variable to avoid conflicts

parent 64033713
No related branches found
No related tags found
No related merge requests found
// TODO: properly isolate these global variables so they don't cause trouble when dropped into other sites
var markers = [];
var accessible_gmaps_markers = [];
var infowindowsEnabled;
var accessibilityMap;
var accessibilityInfowindow;
......@@ -71,8 +71,8 @@ function accessible_gmaps_onload(map, mapIdentifier_given, options){
// Create marker overlays
// We need a timeout - I'm not sure why. But the map bounds aren't caught up with us if we don't wait, and we need the map bounds set before we can position markers.
setTimeout(function(){
for(var i = 0; i < markers.length; i++){
marker = markers[i];
for(var i = 0; i < accessible_gmaps_markers.length; i++){
marker = accessible_gmaps_markers[i];
accessible_gmaps_create_marker_div(marker, i);
}
}, 2000);
......@@ -200,7 +200,7 @@ function accessible_gmaps_create_marker_div(marker, markerIndex){
*/
function accessible_gmaps_infowindows_openInfoWindow(markerIndex){
// Grab map marker; we need its title and windowContent.
marker = markers[markerIndex];
marker = accessible_gmaps_markers[markerIndex];
header = "<h2 id='markerHeader-"+markerIndex+"'>"+marker.title+"</h2>";
// windowContent should have been added to the marker object by the client if they wanted to use the accessible infowindow module.
......@@ -296,7 +296,7 @@ function accessible_gmaps_infowindows_trapTabKey(object,evt, markerIndex) {
* TODO: allow offset to be calculated based on marker size data retrieved from user?
*/
function accessible_gmaps_resetMarker(markerIndex){
marker = markers[markerIndex];
marker = accessible_gmaps_markers[markerIndex];
var markerID = "mkr-" + markerIndex;
// If marker isn't visible, hide the div and move on.
......@@ -332,7 +332,7 @@ function accessible_gmaps_resetMarker(markerIndex){
* that resets all markers in the markers array.
*/
function accessible_gmaps_resetAllMarkers(){
for(var i = 0; i < markers.length; i++){
for(var i = 0; i < accessible_gmaps_markers.length; i++){
accessible_gmaps_resetMarker(i);
}
}
......@@ -344,7 +344,7 @@ function accessible_gmaps_resetAllMarkers(){
* TODO: generalize so this can be called elsewhere
*/
function accessible_gmaps_zUp(){
marker = markers[jQuery(this).data('markerID')];
marker = accessible_gmaps_markers[jQuery(this).data('markerID')];
marker.setZIndex(1000);
}
......@@ -355,7 +355,7 @@ function accessible_gmaps_zUp(){
* TODO: generalize so this can be called elsewhere
*/
function accessible_gmaps_zDown(){
marker = markers[jQuery(this).data('markerID')];
marker = accessible_gmaps_markers[jQuery(this).data('markerID')];
marker.setZIndex(1);
}
......@@ -364,7 +364,7 @@ function accessible_gmaps_zDown(){
* with this shim.
*/
function accessible_gmaps_addMarker(marker){
markers.push(marker);
accessible_gmaps_markers.push(marker);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment