You aren't signed in     Sign In    Help

Flickr Hacks / Discuss

Current Discussion

GM Script: Inline Forum Post Editor - Lets you edit or delete your posts without leaving the page you are on
Latest: 70 minutes ago
Greasemonkey keystroke logger?
Latest: 6 hours ago
GM referrer script fixed
Latest: 10 hours ago
GM Script: Flickr Buddy Icon Reply v3.1 (updated 3rd July 2008)
Latest: 16 hours ago
GM Script: Insert Group Signature Photo Comment Tool
Latest: 19 hours ago
GM Script: Flickr Buddy Icon Reply v3 (old thread)
Latest: 23 hours ago
copyrights: could we prevent people from stealing the pictures?
Latest: 2 days ago
little hearts
Latest: 2 days ago
GM Script: Picasaweb Album Export to Flickr
Latest: 2 days ago
GM Script: Flickr Home Page Change
Latest: 3 days ago
GM Script: Display photo counts alongside tags in photo pages
Latest: 3 days ago
Is it possible to stop people who comment from using "Flickr Bling"?
Latest: 3 days ago
More...
spacer image

GM Script: Google Map on Photo page

view profile

ebotunes  Pro User  says:

Hi everyone!

I made my first attempt at a Greasemonkey script the other day. I'd be interested to know what people think of it.

It's pretty simple, just displays a little Google Map on a Flickr photo page, with the location of the photo (if available!). I had a look around but couldn't find an existing script that did this, which was quite surprising. It was made an awful lot easier by the new Google Maps Static API.

Google Maps Greasemonkey script

Download the 'Google Map on Flickr photo page' script here

If anyone can think of a snappier name let me know :)

Also, obviously i'd love to know if my script gets popular - but I cant really think of a good way to find out how many people are using it? (unless i'm missing something really obvious!)

Thanks!!
Iain
Originally posted at 6:21AM, 14 April 2008 PDT ( permalink )
ebotunes edited this topic 3 months ago.

view photostream

ToniVC  Pro User  says:

Nice script, but I have two suggestions:

1) I'm not getting the image loaded at firts time I load the page (I only get an error icon). I need to right-click on it, click "See image" and then reload the page to actually see the embedded image. But this could be my fault. Any one having this problem too? I use Firefox.

2) I would advise you to convert the image to a link to Google maps, or add some control buttons to zoom out or move. The problem is sometimes such an small map gives almost no info on where the place actually is...

Thanks ;)
Posted 3 months ago. ( permalink )

view photostream

ebotunes  Pro User  says:

Thanks Toni!

1) Yes i did notice that error on another computer i tried, but havent had a chance to investigate the differences. What are you running? Mac/Windows , Firefox version?

2) Yes the link to Google Maps i had in mind. As for the zoom/move buttons, this isnt possible using the Static Maps API, since the map you see is literally just a GIF image. (i suspect the reason no-one had tried this script before is becuase the Google Maps Javascript API made it too messy/restrictive?!)

Another thing I need to fix is to have it keep the "Taken in .... " text and just add the map below it, rather than replacing completely.

Keep em peeled for version 0.2 ;)

Thanks again
Iain
Originally posted 3 months ago. ( permalink )
ebotunes edited this topic 3 months ago.

view photostream

mortimer?  Pro User  says:

Ok, maybe it's because I have firefox 3b5, but I just get an empty item with a not found image.
The image location is:
maps.google.com/staticmap?center=51.524488,%20-0.071722&a...
Posted 3 months ago. ( permalink )

view photostream

ToniVC  Pro User  says:

Iain, I use Firefox 2.0.0.13 on Windos XP.

As for point 2, I think a link to Google Maps to see there the location would be the best solution. Keeping the "Taken in..." text would also be a great idea, but still I think the map linked to Google Maps should be there.

I'll wait for v0.2 ;)
Originally posted 3 months ago. ( permalink )
ToniVC edited this topic 3 months ago.

view photostream

ebotunes  Pro User  says:

OK here goes, version 0.2:

* Image is a clickable link to Google Maps, at the given location.
* The "Taken In.." text is preserved.

I also tweaked the image URL slightly to stripout whitespace (note the '%20' bit in mortimer's url above). Please let me know if this fixes the image loading issue (as i said it has always worked fine on my machine - Mac / Firefox 2.0.0.13 / Greasemonkey 0.7.20080121.0 )

userscripts.org/scripts/show/25247

Todo for Version 0.3 - when you get to Google Maps, having clicked the thumbnail, the marker is not displayed to pinpoint the exact location - cant figure out how to do this yet :(

Cheers,
Iain
Originally posted 3 months ago. ( permalink )
ebotunes edited this topic 3 months ago.

view photostream

ToniVC  Pro User  says:

Just tested version 0.2, and I still am having the problem of image not loading at first. I need to use right mouse button over the error icon to force viewing the image and then reloading the page shows the image embedded. I'm using Windows XP/Firefox 2.0.0.13/Greasemonkey 0.7.20080121.0.

The link to Google Maps at the given location is a great addition, and works well. I have no idea about how to display the marker...
Posted 3 months ago. ( permalink )

view photostream

mortimer?  Pro User  says:

nothing better for me, I still get a 'bad request' for the image.
Posted 3 months ago. ( permalink )

view photostream

ebotunes  Pro User  says:

OK thanks guys, i'll keep testing :(
Posted 3 months ago. ( permalink )

view photostream

ebotunes  Pro User  says:

Oh and also I just discovered userscripts.org which hosts GM scripts and tracks how many people have installed it.

userscripts.org/scripts/show/25247

cool!
Posted 3 months ago. ( permalink )

view photostream

ToniVC  Pro User  says:

Yes! I thought I already pointed you to that site! Now I see I did not ;)
Posted 3 months ago. ( permalink )

view photostream

Charlie Wild  Pro User  says:

Great idea!

Unfortunately, I'm located in Spain, so the Flick map information comes with a comma (,) instead of a period (.)

Apparently, Google can't read those URL's:

BAD =
maps.google.co.uk/maps?z=14&ll=40,95288,-4,131041

GOOD=
maps.google.co.uk/maps?z=14&ll=40.95288,-4.131041

It would be great if you coud use some kind of regionalization according to user's machine.
Originally posted 3 months ago. ( permalink )
Charlie Wild edited this topic 3 months ago.

view photostream

ebotunes  Pro User  says:

Great info Charlie, thanks. I'll see if there's a way I can accomodate that in the script.
Posted 3 months ago. ( permalink )

view photostream

Saint Seminole  Pro User  says:

I'm using Firefox 2.0.0.4 on a Windows XP machine, and I'm having the same problems mentioned by those above. No image, just the placeholder.

After I right-click and use "view this image," then I can hit the "back" button and see the map's icon in the page. But I have to do this every time I view a map-enabled page.
Posted 2 months ago. ( permalink )

view photostream

pippozzo says:

Hi all! First post here.

I have the same problem as Saint Seminole here on FF 3b5 it-it and Flickr (italian).
I made some editing to the js code:

var coords = coord.split(' ');
var lati = coords[0];
var longi = coords[1];
lati = lati.replace(",",".");
longi = longi.replace(",",".");

var ll = lati+longi;


I replace "," with "." because Google(It) doesn't works with ","
Now maps are loaded but only if I do Saint Seminole steps.

I think most problem are in the "&" in the variable imgUrl.
The "&" are converted in "$amp;" when printed in the Html.
Then the browser can't load the url.
I also tried many ways, eg. an url like this:
var imgUrl = 'http://maps.google.com/staticmap?center='+ll+'&markers='+ll+'&ampzoom=14&size=150x150&key='+GMAP_API_KEY;
Anyway... nothing.
Browser can't load the image in the cache.
???
Posted 2 months ago. ( permalink )

view photostream

Steffan Harries  Pro User  says:

I'm getting the same 'View Image' and then return to the photo page issue.

Great idea for a GM script and I'd love to see this become popular! I'm surprised Flickr haven't thought of this themselves...
Posted 2 months ago. ( permalink )

view photostream

ebotunes  Pro User  says:

wow thanks for the input pippozzo - i'm hopefully going to work on this again in the next few days...got a bit more spare time now - thanks!!!!!

i'll look into the multilanguage issue and the &amp ; thing .... i'll keep you all posted.

Iain
Posted 5 weeks ago. ( permalink )

view photostream

pippozzo says:

Hope you can patch the errors ebotunes.
It's really a great extension!
Posted 5 weeks ago. ( permalink )

Would you like to comment?

Sign up for a free account, or sign in (if you're already a member).

RSS 2.0 feedSubscribe to a feed of stuff on this page...</!!> Feed – Subscribe to Flickr Hacks discussion threads
Add to My Yahoo!