I have map where a person can click on a marker location to view a building on my University’s campus. http://mypower.herokuapp.com/map
Users can then, click on either the picture or title, which both link to the energy usage graph page.
However, when I try to do this from the maps page, the buildings graph page is missing the graph and other graphics elements. In addition, when I click on the tab on the lower left hand corner that says ‘graph’ of the graph page, it leads me back to the map page, which isn’t supposed to happen.
Now, when I do all of this, but then manually refresh the broken graph page I’m on, the page looks great (the way it should look like).
Using a combination of html and a little ruby, I create a string of the html for the contents of the popup windows of a map marker.
def gmaps4rails_infowindow
"<center><a href=\"/halls/#{self.id}/\"> #{self.name}</a>
<br>
<a href=\"/halls/#{self.id}\"><img src= \"/smallbuildings/#{self.name}.jpg\"></a></center>"
end
Clicking on the link goes to the right page. The graphic elements just aren’t rendered for some reason.
Adding
target="_parent"fixed everything.