Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Googlemaps breaks curtain... #32

Open
RemcoBakker opened this issue Dec 11, 2012 · 3 comments
Open

Googlemaps breaks curtain... #32

RemcoBakker opened this issue Dec 11, 2012 · 3 comments

Comments

@RemcoBakker
Copy link

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>
@ecruhling
Copy link

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.

@mlynarczyk
Copy link

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

@RemcoBakker
Copy link
Author

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 [email protected] 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
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants