There are two problems. One the maps are not initializing. Two whether they do or not, the layout is messed up.
The second one is because the act of importing the content puts an extra </div> tag in there when the map tag is used. To fix that, on the content page uncomment the map tags and get rid of the self closing slash in their div tags, ex:
Code:
<!-- <div id="map_canvas" style="width:340px; height:300px; float:right; padding: 0 0 10px 5px; border:0;" /></div>-->
becomes:
Code:
<div id="map_canvas" style="width:340px; height:300px; float:right; padding: 0 0 10px 5px; border:0;"></div>
Do that for all ten of them. It's invalid markup anyway (having a self closing slash on a div element), the page that works must be error correcting for it.
On the page that's importing content, get rid of the highlighted:
Code:
<body onload="initialize()">
Using a text only editor like NotePad, open up the featuredcontentglider.js file and find this code (around line #41):
Code:
getremotecontent:function($, config){
config.$glider.html(this.ajaxloadingmsg)
$.ajax({
url: config.remotecontent,
error:function(ajaxrequest){
config.$glider.html('Error fetching content.<br />Server Response: '+ajaxrequest.responseText)
},
cache: false,
success:function(content){
config.$glider.html(content)
initialize();
featuredcontentglider.setuptoggler($, config)
}
})
},
Add the two highlighted lines. Save and use that version. What that will do is import the content and then initialize its maps and then set it up as a glider. I've tested it and it works here in Chrome, Firefox, and IE 9. I'll test in some others when I have more time.
Now, I'm thinking, that's great for what you currently have. But how do we add new buildings with new maps? I'm thinking that, since jQuery is already on the page, and that there are certain commonalities of each map's init, we could detect each map after the content arrives and run a generic map init function for each one, plugging in values from the map tags, ones that are there already and/or ones we can put there. Probably only the id and lat/long need to be passed in from the tag.
But let's get the basic idea working for you first.
BTW, the page has two versions of jQuery on it, one right after the other. Only the second one would be used and I'm not sure if either is the optimal version. Again, let's not worry about that yet. Let's first get the basic idea working for you as it does for me.
The browser cache may need to be cleared and/or the page refreshed to see changes.
Bookmarks