imaffett / jqMobi-Plugins

Plugins for jqMobi
http://www.jqmobi.com
MIT License
24 stars 9 forks source link

Maps plug in - map tiles not filling map div #1

Closed surfjedi closed 12 years ago

surfjedi commented 12 years ago

I love JQMobi! But the maps plugin isn't working when actually inside a JQMobi with JQui app.

I have tried to put in several app i have, and just in the JQmobi 1.0a demo app from the archive download.

The problem - the map tiles don't fill the map div specified.

I see that it works in the short index.html file included with the maps plugin, but that not a full jqmobi app.

Once you put in the JQmobi 1.0a demo app the map tiles don't fill the map div.

Or is there a map plugin demo inside the 1.0a demo some where?

thanks in advance

surfjedi commented 12 years ago

And partial progress - by deleting all the "appmobi specific" scripts, i have got a map loaded in the initial div viewed to be filled with map tiles properly.

But any map in a different div than the initially displayed div, still doesn't get filled with map tiles.

I have searched a bit and found it has to with the div not being drawn, and google maps script not actually getting the size of the div when loading the map.

It seems like the map needs to be redrawn and resized after the div(jqmobi panel) containing map div is displayed..

But I'm having trouble figuring that out.

Any ideas?

thanks in advance

imaffett commented 12 years ago

I'll add a function to "refresh" the map tomorrow. For now, you can do the following.

add a data-onload function for the panel...eg

<div id='maps' data-load='resizeMap'>
</div>

function resizeMap(){
google.maps.event.trigger($("#mapid").gmaps(), 'resize');
}