Sometimes google map comes partially with other area getting grayed out. There is one catch, if we start Firebug, images do come in that gray area. Dont know why this is happening. Anybody ever experienced this and found solution, Please share.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
I found a simple solution for the partially loaded google map. Usually it is caused by the
onLoad()
being called at times when the rest of the page (including your map element) is not completely loaded. This causes partial map load. A simple way around this issue is to change youronLoad
body tag action.The old way:
The new way:
This waits 2 seconds before the Google Javascript accesses the correct size attributes. Also make sure to clear your browser cache before trying it; sometimes it gets stuck there :)
This is my top Javascript part in case you wondering (exactly as described in Google Documentation but because I am calling the
Latitude
andLongitude
from PHP variables, hence the PHP snippets.I just wanna add to this discussion that I had this problem with grey stripes aswell, and this wasen't the same issue that I needed to use the gmap.Resize Function but that it was in my css. In my css I had
so when I set this in my css file
The problem disappered! I looked all over google but couldn't find this answer.
If you are using v3 try
Also take a look at here