Victa / curtain.js

PROJECT IS NOT MAINTAINED - This plugin allows you to create a web page with multiple fixed panels that unroll with an amusing effect.

Home Page:http://curtain.victorcoulon.fr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Googlemaps breaks curtain...

RemcoBakker opened this issue · comments

When implementing googlemaps on my basic curtain-based site, the page starts acting weird. The script doesn't go to the right anchors and the pages are losing background images etc.

This is what i'm using to implement my googlemaps.

<script type="text/javascript"> function initialize() { var myLatlng = new google.maps.LatLng(52.37659, 4.88747); var mapOptions = { zoom: 16, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); } </script>

if the GoogleMap is in a curtain section that is not initially displayed, you have to wait to initialize the map. You can check for this using the nextSlide callback. In my case, the curtains worked but the map would not display correctly.

initiate your map like this //this will also keep ur map in place
google.maps.event.addDomListener(window, 'resize', function() {
map.setCenter(new google.maps.LatLng(52.400398, 16.895132));
});
also if google map is initially in hidden container it gonna bug out, in order to fix this you want to simulate resize on some event that suits your case
$(window).trigger('resize');
(also check with google.maps.event.trigger(map, 'resize');)
(check https://github.com/Victa/curtain.js/blob/development/v2.0/curtain.js#L305 to see why)

//yes i know its been 8 months since you asked

I have already found good alternatives:) Thnx for the reply anyways, but as
you have already mentioned, it's been 8 months!

On Wed, Aug 21, 2013 at 9:29 PM, mymlyn notifications@github.com wrote:

initiate your map like this //this will also keep ur map in place
google.maps.event.addDomListener(window, 'resize', function() {
map.setCenter(new google.maps.LatLng(52.400398, 16.895132));
});
also if google map is initially in hidden container it gonna bug out, in
order to fix this you want to simulate resize on some event that suits your
case
$(window).trigger('resize'); (check setDimensions function in curtain.js
to see why)

//yes i know its been 8 months since you asked


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-23043283
.