| Issue 102: | googlemaps in nyroModal not centering correctly | |
| 3 people starred this issue and may be notified of changes. | Back to list |
I have a list of links that when clicked opens an iframe nyroModal for my Maps.php file. If i use nyroModal alot locations on the map are not centered, some are slightly off, others times the map is completely unzoomed to show the entire globe. If i take the same link and just show it in a normal IE window everything works fine, so something with nyroModal is causing a conflict with the google maps api I use. Any ideas?
Oct 25, 2008
Instead of sending your PHP file which are related to a database, could you send me HTML sample or link please?
Oct 26, 2008
I attached the google map php because it has the javascript that displays the map, I thought perhaps there was a conflict with the code in that file with your plugin. Here is a snippet of the php that generates the links for the map. echo "<a href=\"Map.php?food_cat_id=$row[food_cat_id]\" id=\"maplink\" class=\"nyroModal\" target=\"_blank\"><img src=\"images/goldglobe.gif\" alt=\"Map It\"></a><BR />"; And here is the page that with the links. If you click on different globes you'll see sometimes those locations are fine, other times they are slightly off centered and the other times they are completely off, showing the whole world and not zoomed in at all. http://scanlon.mine.nu/DubCMenus/DineIn.php Thanks for your help.
Oct 26, 2008
Oh I forgot to mention, if I don't use an iframe modal and just use a normal ajax call the map doesn't show up at all. So there seems to be some sort of conflict. If you click on one of the categories on the site I gave and then click the globe on the restaurant name you'll see what I am talking about, I have those links set up as a normal ajax call. -John
Dec 4, 2008
Hi, I'm working at the same thing: loading google maps in nyromodal. The issue is
solved by running the google map creation code in the endShowContent callback.
Example:
endShowContent: function(elts, settings) {
var map = new GMap2(document.getElementById("map"));
}
It seems that running this code before, when the content is hidden or even when the
google map container is not fully visible, leads to problems.
The problem should be fixable even by adjusting the map's div width and/or height at
runtime, but I failed to find a way, and applying the map at endShowContent is
enough for me.
for redimensioning the map, see http://koti.mbnet.fi/ojalesa/exam/design_aid.html
Hope it helps,
g_gus
Jan 26, 2009
in the next version, you'll be able to indicate to nyroModal if you want a script tag to be exectued once the modal is shown by siimply add the rev="shown" to the script tag
Status:
Fixed
Feb 11, 2009
with the version 1.4.0 you know have the possibility to execute a script once the modal is shown by adding rev="shown" on your script tags.
Sep 11, 2009
I have the same problem, how i solve that? When i open a google map on nyromodal, the modal lost their width and height.
Mar 7, 2010
Dear nyrodev, Could you please provide more information about this rev="shown" option? Where am I suposed to insert it? I do not understand. thanks, bd
Mar 7, 2010
@bmontereau: please read the last paragraph of http://nyromodal.nyrodev.com/#usage The rev="shown" attribute should be in the scripts tags you want to execute once the modal is shown and visible to the user. |
47.5 KB View Download
2.0 KB View Download