Problem with Google Maps in Smugmug
Lawrence.young
Registered Users Posts: 20 Big grins
Hello - My name is Lawrence and I have been with Smugmug for a short time. I have recently added a map via Google API to my page. I created a separate Gallery for the Map. I am now experiencing a minor issue with the map I'm hoping you can help me with. My map is showing up as a half display. This seems to be a common issue in a couple of threads however none of them have been able to solve my particular issue. I have tried moving the javascript from the footer to the header as in a few other threads but this has no effect to fix the problem. It just simply takes away my additional galleries. I would be more than happy to entertain any suggestions on the topic. Thank you so much for any help.
Lawrence
www.theyoungspace.smugmug.com
Lawrence
www.theyoungspace.smugmug.com
0
Comments
I start to think this is a real bug not fixable :cry.
http://www.dgrin.com/showthread.php?t=98881
Cheers,
Adriano
http://photos.lmsportspix.com/map/
SmugMug Support Hero
Let me know if you come up with anything. I really like this feature but can't find anyone who can get it to work just right. Thanks for any help.
Place the following in the header javascript section:
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}
The rest of the code will need to go into the header section, something like this:
<*script type="text/javascript"*>
if (hasPath("galleries"))
YD.addClass(document.body, "galleries");
if (hasPath("map"))
YD.addClass(document.body, "map");
<*/script*>
Your code may be different than what I have here, but you get the idea
Remove the *'s prior to pasting
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}
if (hasPath("mapGallery"))
YD.addClass(document.body, "mapGallery");
if (hasPath("galleries"))
YD.addClass(document.body, "galleries");
Pasted into my Javascript Footer Section in this exact order. If I reverse the order of the two I seem to run into issues. When ever I try to place the hack into my Javascript Header Section I loose my Galleries & the Map Page. Any other ideas or am I just applying it wrong? Please let me know what you think.
I'm not sure if this will help figure out where the problem is. I'm not sure it's actually with my coding or not. Now that I'm looking at it I went ahead and hid the map so it wouldn't be seen in half form anymore. I have noticed that even when the map hidden in my control panel it still appears in the same half view. I wouldn't think the coding would be affecting it in this location. I could be wrong.
Let me know if you come up with anything. Thanks
Sorry for chatting your ear off. I got it figured out and everything is working perfectly. Thank you for all your help.
Thank you!
Adriano
Rich, thanks this works great with one exception: when I click on a pic on the map, it brings me to the pic on "digitalphotographybyfrank.smugmug.com" rather than the pic on www.digitalphotographybyfrank.com -- any way to keep the custom URL live from map page to map to clicked photo?
Thanks again.
http://maxelman.smugmug.com/map
But moving around the JavaScript hasn't changed anything.. Any ideas?
Thanks!
To add to the weirdness, I tried to use the web dev toolbar to troubleshoot a little (for example by NOT hiding it on my first homepage) but when I show the web developer toolbar the map fixes itself! Without reloading the page or anything, something about simply showing the web dev toolbar (i.e. View>Toolbars>Web Developer) corrects the issue in FF3 (I don't have it shown by default).
By the way, razorfrog, your "Around The World" map looks fine to me, except that it is the whole world when your pictures appear to be only in the NW hemisphere. I'm not clear on whether that's supposed to be the behavior or not. If I don't hide the map on my homepage it displays (on my homepage and on my galleries page) only the area encompassing my geotagged photos...
Also, I should be clear about what I mean by the map fixing itself above - the map displays completely in the box. It doesn't recenter on my pictures or anything like that.
Is this thing on?
Portfolio • Workshops • Facebook • Twitter
Will need a link to your site to look
maxelman.smugmug.com/map now works!
maxelman.smugmug.com/map
Thanks-
Oops. I put it in the first post I made about his issue but forgot that was in another thread...
http:\\monkeytales.smugmug.com
I don't have time to look at or try the link you suggest above, but I'll check it out later today. Thanks for looking into this!
EDIT: I was about to say that I tried that and it didn't work, blah blah blah, when I read your instructions a little more carefully and put the first section of code in my header Javascript. That fixed it... And here I was tapping my foot impatiently when the answer was already given. What a schmo! Sorry, and thanks, Rich!
You're Welcome....
Just a curiosity at this point really...
EDIT: I deleted all the other photos (in unlisted galleries) and they're still showing on the map - so maybe it's cached somewhere?
EDIT2: Now it's only displaying the one - so making them unlisted didn't hide them but deleting them got rid of the data after some relatively short refresh time (maybe 20 min?)