It looks like you just need to declare your routes as global variables. Add the following to the top of your script var bromley_route638, bromley_route638Run2.
Here is the full JSFiddle Demo: Here is one way to do it, but the code can be optimized. First I added two new functions removeMarker and checkMarker. RemoveMarker, removes a marker from the map and also from the array so you won't have lingering markers at the same spot more than once.
CheckMarker, checks to see if the marker is already on the map and in the global markersArray. It returns true if it is else returns false. We use checkMarker to make sure we don't create multiple instance of the marker at the same latlng.In your case it's marker route 1 and marker route 2.
//remove specific marker from map function removeMarker(myMark) { if (markersArray) { for (var I in markersArray) { if (myMark == markersArrayi'number') { console. Log(markersArrayi'number'); markersArrayi. SetMap(null); markersArray.
Splice(i,1); //removes marker from array break; } } } } //check if marker already exist on map function checkMarker(number){ if(markersArray){ for(var I in markersArray){ if(markersArrayi'number' == number) return true; } } else return false; } I then add a marker checker using checkMarker to make sure we don't create double marker with it's associate route, and also I gave your maker an unique "number" identifier. With 1 being marker1 and 2 being marker2. These two mod should be in functions showRoutePath_1 and showRoutePath_2: //check if marker1 already on map if true do nothing if(checkMarker(1)) //check if marker already in global marker array/map if marker 2 replace 1 with 2 return; position = new google.maps.
LatLng(51.41859298, 0.089179345); var infowindow = new google.maps. InfoWindow({ content: "Beaverwood School" }); var marker = new google.maps. Marker({ position: position, map: map }); marker'number' = 1; //Here is the unique identifier we assign.
If marker 2 replace 1 with 2 Last but not least, I change your hideRoutePath by adding an identifier param "number", and use removeMarker function to hide/remove the associate path and marker: function hideRoutePath(number) { if (number == 1) { //clearOverlays(); bromley_route638. SetMap(null); } else if (number == 2) { //clearOverlays(); bromley_route638Run2. SetMap(null); } removeMarker(number); }.
It looks like you just need to declare your routes as global variables. Add the following to the top of your script.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.