Thanks guys. But I think I have it like you say!? And thats why I dont understand it.
This is how googlemap2.asp looks:
function localiser() {
if ($("#map_canvas").html()) return;
if ((window.orientation == (-90)) || (window.orientation == (90))) {
var width = 520; var height = 285;
$('#map_canvas').css("width",width+"px");
$('#map_canvas').css("height",height+"px");
$('#map-overflow').css("width",(width-40)+"px");
$('#map-overflow').css("height",(height-10)+"px");
} else {
var width = 360; var height = 435;
$('#map_canvas').css("width",width+"px");
$('#map_canvas').css("height",height+"px");
$('#map-overflow').css("width",(width-40)+"px");
$('#map-overflow').css("height",(height-10)+"px");
}
var myLatlng = new google.maps.LatLng(57.127426175, 12.26577967);
var myOptions = {
zoom: 16,
center: myLatlng,
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
var image = new google.maps.MarkerImage("info.png",new google.maps.Size(32, 37));
var shadowi = new google.maps.MarkerImage("shadow.png",new google.maps.Size(51, 37));
var myLatLng = new google.maps.LatLng(57.127426175, 12.26577967);
var beachMarker = new google.maps.Marker({
position: myLatLng,
map: map,
shadow: shadowi,
icon: image
});
}
jQT = new $.jQTouch({
});
$(document).ready(function(e){
$(function(){
$('body').bind('turn', function(event, info){
var curr = $(".current").attr("id");
switch (curr) {
case "map" :
if (info.orientation == "landscape") {
var width = 520; var height = 285;
$('#map_canvas').css("width",width+"px");
$('#map_canvas').css("height",height+"px");
$('#map-overflow').css("width",(width-40)+"px");
$('#map-overflow').css("height",(height-10)+"px");
} else {
var width = 360; var height = 435;
$('#map_canvas').css("width",width+"px");
$('#map_canvas').css("height",height+"px");
$('#map-overflow').css("width",(width-40)+"px");
$('#map-overflow').css("height",(height-10)+"px");
}
break;
}
});
});
$('#map').live('pageAnimationEnd', function(event, info){
if (info.direction == 'in') {
localiser();
}
});
});
And the seperate page that I load (googlemap3.asp) looks like this:
<div id="map" class="notransform">
<div class="toolbar">
<h1>Map demo</h1>
<a href="#" class="back">Back</a>
</div>
<div id="map-container" class="notransform">
<div id="map_text">This is my location</div>
<div id="map-overflow" style="overflow: hidden; padding: 0; border: 0;" class="notransform">
<div id="map_canvas" style="margin-left: -20px; margin-top: -20px;" class="notransform"></div>
</div>
</div>
</div>
If I have the above div in the googlemap2.asp instead of googlemap3.asp then it works!
I really hope that you know whats wrong, because I dont :-)