Don't think you need a post render event, just add this line of code in the GMaps.controller.js file! Although I think I orginally removed this line of code as it wasn't working as exptected... which it currently isn't either :(
I added the code line Jesper (and several on StackOverflow) recommended on places in the code I found logical: initializeMap() and resetMap() but with no success. google.maps.event.trigger(map,"resize");
I'm pretty sure the issue has to do with multiple maps (as I've had this problem before). It seems as if the map script gets confused when switching between nodes with maps on them. I would have thought the entire page gets reloaded when I switch node in Umbraco but that doesn't seem to be the case, hence the google maps script misinterpret the size of the container of the map.
Unfortunately I know too little about the rendering order of the scripts to find a solution to this. But some ideas is: - Try a different naming logic where the map container always have a unique name, like "map-<node id>" - Change the rendering flow so the map initialization is triggered after the new map area is loaded.
Render only part of map
Hello. Nice extension.
When I open document first time it render not full, just a part.
But then I resized my browser window and it take right size
Regards, Anton
Hi guys
I've actually seen this issue too so +1 from here. If I find some spare time in near future I might have a look at the source.
/Jan
Any news on a solution?
Same problem here.
Workaround - if you resize browserwindow it fixes the problem (until next load).
I've tested a different package that loads a google map and it does exactly same.
best
Jesper
http://stackoverflow.com/questions/15051796/google-map-only-show-half-screen
Post suggests executing following statement after map is displayed. Do Property editors have a post render event?
google.maps.event.trigger(map,"resize");
best
Jesper
Jesper,
Don't think you need a post render event, just add this line of code in the GMaps.controller.js file! Although I think I orginally removed this line of code as it wasn't working as exptected... which it currently isn't either :(
Let me know if that fixes it for you.
--Dirk
I have this problem too. I can't seem to find the file GMaps.controller.js either. Where is it located?
Thanks,
Daniel
~/App_Plugins/GMaps folder
--Dirk
I added the code line Jesper (and several on StackOverflow) recommended on places in the code I found logical: initializeMap() and resetMap() but with no success.
google.maps.event.trigger(map,"resize");
I'm pretty sure the issue has to do with multiple maps (as I've had this problem before). It seems as if the map script gets confused when switching between nodes with maps on them. I would have thought the entire page gets reloaded when I switch node in Umbraco but that doesn't seem to be the case, hence the google maps script misinterpret the size of the container of the map.
Unfortunately I know too little about the rendering order of the scripts to find a solution to this. But some ideas is:
- Try a different naming logic where the map container always have a unique name, like "map-<node id>"
- Change the rendering flow so the map initialization is triggered after the new map area is loaded.
Best,
Daniel
What Daniel says appears to be true. As soon as I add the map to a document type where I have multiple of, it renders only a small corner.
Hope you can find a solution.
This is how I've managed to overcome it, adding a slight delay to the loading of the script:
http://our.umbraco.org/projects/backoffice-extensions/google-maps-property-editor-w-google-places-autocomplete-lookup/bugs,-feedback-and-suggestions/53913-Fix-for-the-resize-bug
350ms was the lowest I could go before it failed to render.
is working on a reply...