Inline Google Maps for WordPress updated to version 2.1

Finally, I had some time to juggle with the Google Maps code today, so here's a new update. :) (download link is at the bottom of this page!)

New stuff in this update is that basically you gain more control per map. Place Google map into your sidebar if you with, display maps in different sizes, show or hide map controls on per-map basis, as well as show/hide the marker on per-map basis! You can even choose if you want the google-map link to be replaced with a google map or not (in case you just would rather have a plain link to google maps site instead of inline map on your site).

{w:450;h:100;controls:false;marker:false}Kremlin
So, how can you use these new features? Easy.

When you adding a map, you do the following - type a text to appear inside the marker, and then "link" this text to a google map location (you can find more info on basic operations on the plugin's original page) . The secret of configuration is that in order to have per-map settings, you need to add some text at the beginning of the marker text.

So, for example, if you want to have a map of width=400 pixels, height=100 pixels, with no map controls, and no location marker shown, you would craft a text like this one:

{w:400;h:100;controls:false;marker:false}Kremlin

That's exactly the code I used to show the map in the beginning of this page. And of course you will then link this text to a google map location. Like that:

gmapnew.jpg

Of course, the controlling part of the link (ie the stuff inside curly brackets) will be removed from the final output.

Here, again, the parameters you can use inside the curly brackets to control the appearance of maps.

Important: all the parameters should be placed in the beginning of the link text, enclosed inside the curly brackets. All parameters must be divided by semi-colons (;).

Parameters:

  • w:xxx;h:yyy - sets width and height of a map, respectively. Both "w" and "h" parameters must be present in order to set the dimension of a map. If not present, default values will be used (these values are set in the plugin's options panel in WordPress admin)
  • controls:false - hides all controls of a map. Particularly useful in cases of small maps where there is just no place for controls. If not set, or value is set to anything other than false, map controls are displayed.
  • marker:false - hides position marker of a map. Because there are times when you don't need to show a marker. If not set, of value is set to anything other than false, position marker is displayed.

Some examples:

"{w:200;h:300}My map" - sets map dimensions to 200 pixels width, 300 pixels height, and marker's text to "My map"

"{controls:none}My map" - shows map at default size, with no controls. Marker's text is set to "My map"

"{w:100;h:500;marker:false}My map" - map of 100 by 500 pixels, with no position marker displayed.

One more feature

There is one more new feature in this version which worth mentioning. There are times when you just want to have a simple plain link to a Google Maps site, rather than having a map rendered directly on your page. Like this one:

Somewhere near the place I live

On order to do that, just add the title "nomap" when you linking the text to Google maps site. Like that:

gnomap.jpg
That's all :) Have fun with the new version. And if you need more instructions on initial setup of Inline Google Maps, just follow this link to the original Inline Google Maps blog entry.Download: Download Inline Google Maps plugin version 2.1

45 Responses to “Inline Google Maps for WordPress updated to version 2.1”

  1. Bianca Says:

    Love the plugin but I'm having a small problem. I've installed it as instructed, added my API Key but when I attempt to create the link I'm not given the link box that you have displayed above… all I get is the regular wordpress script link box that doesn't have the Target and Title fields. Am I missing something?

  2. Avi Alkalay Says:

    Well, I think regular links (and not maps) are the ones that need titles like "Click to see map of the country side". But this way all titles except "nomap" will be useless.

    The positioning features are great, but they'll look bad on RSS readers because they don't have the GMaps API or JS capabilities.

    I still think the best way is to overuse the title like this:

    title="gmap" or….

    title="gmap w:300 h:200 nocontrol nomarker"

    If the title has something different that gmap, a regular link is rendered.

    The only drawback for this suggestion is that its not backwards compatible, and people will have to change the titles on their blogs.

    On the other hand, the current implementation is backwards incompatible with blogs that already have regular links to Google Maps in the middle of some phrases. I have this situation in my blog, and sh*t happens on old posts when I install this plugin.

  3. mike Says:

    Avi,
    indeed your point regarding "nomap" in all the titles is very valid. Fortunately, it's pretty easy to fix, so I'll do that in next update :)

    Regarding putting the control commands inside the title though, I'd rather have them visible and easily editable when editing the post than trying to guess which parameters are actually set (not that there are going to be lots of maps of any single page, but still. But yes, your arguments are also valid, so may be I'll just implement both ways to mark a link as a gmap in next revision, keeping backward compatibility through 2.x series.

  4. mike Says:

    Bianca,
    I'm kind of puzzled why you don't have these fields. Your WordPress is version 2.x, and the admin theme is not a custom one right?

  5. Bianca Says:

    Hi Mike,
    Standard Admin theme and I'm on version 2.0.4. I could be that another plugin is the cause… I haven't gone through the list and played with that yet. I am having a problem with IE blocking scripts. Tried to change my settings and IE freaked out. The plugin is working great, except for the controls.

  6. Bianca Says:

    Turning off my plugins doesn't change anything. I've set IE to allow websites to prompt for info using scripted windows which took care of IE blocking.

    Was wondering if maybe I installed something wrong. Your zip file had 3 files in it: gmaps-v2.php, a folder called _macosx that contains a file called ._gmaps-v2.php and an unknown file called _macosx.

    When I unzipped I only had the gmaps-v2.php and the file folder _macosx. I placed both the file folder and the gmaps-v2.php file into my plugins folder. Was that correct?

  7. Bianca Says:

    I figured it out…. good grief, feel like such an idiot :)…. I was not using the Visual Rich Editor…. you have to have it turned on to get the control box. Sorry for the confusion…. love the plugin!

  8. mike Says:

    Bianca,
    thanks for the info! I'm sure it will help other people having the same problem:)

  9. Avi Alkalay Says:

    Mike, I needed to use the plugin right now, so I reworked it a little bit and documented all here.

    I hope we can merge all this work some day. I believe the way I took is the correct way to go.

  10. mike Says:

    Avi,
    that's a very nice update you have made :) So I guess let's do it this way - your updated version becomes the main branch, and my version lives for compatibility in case somebody already installed it on their computers. This way there is not need to make any code-merge of stuff like that and we can just push the version which works the best, which is yours.

  11. kenji mori Says:

    yeah yeah simple is best. looking great. let me try later on. when i m home. i m at office. so..

  12. Upekshapriya Says:

    Hi Mike

    I don't seem to be getting the link to translate to a map - I am sure it was working earlier today - now I just get a plain link - this is with 2.1 and 2.0 - maybe Google have changed their API because you don't have a map at the top of this page either - just the info {w:450;h:100;controls:false;marker:false}Kremlin !

  13. mike Says:

    Upekshapriya,
    sounds like problems with your browser. everything's fine here in Firefox 2. what browser do you use?

  14. Upekshapriya Says:

    Yes sorry - there was a conflict with another plugin and at the same time I hadn't allowed scripts with NoScript extension for Firefox for your site!!! Working ok now. Thanks for getting back.

  15. B-Blog Says:

    Neues Feature…

    Hallo.
    Nach stundenlanger Suche habe ich endlich gefunden was ich gesucht habe. Ab heute kann ich euch nämlich immer zeigen wo ich mich gerade befinde. Heute bin ich also hier, im schönen Münster, in meiner Wohnung.
    {w:400;h:400;controls…

  16. Øyvind Says:

    I don't get it to work. The map shows up all blank. It's here: http://nrkbeta.no/index.php/hvor/

    I tried in both Safari (Mac) and latest version of Firefox (Mac). No luck.

  17. Kevin Says:

    Mike,

    Having some trouble. I've followed the instructions and can't seem to get things working. All I want is a default 300px by 300px map, nothing fancy. Every time I link to the google map and post/publish all I get is a link to the map.

    http://www.kevinleary.net/wp/

  18. Dawud Says:

    I'm trying to get two different maps on the same WP page. What I'm getting is the second map on the page is a mirror of the first. If you look at the code, the Google Maps link is different - though what's displayed isn't. Advise?

    http://drtraviselliott.com/contact-dr-travis-elliott/

    Thanks.

  19. macdiggs.com » Blog Archive » Inline Google Maps plugin for WordPress : version 2.1 Says:

    […] the instructions in this post are related to version 2.0 of the plugin. Version 2.1 adds some new advanced settings which are not described in this entry. If you are new to the […]

  20. sabin Says:

    Can u be more specific. I followed the steps you described, but i can't get my marker to show up by pressing the ballon. Can u provide some help about that?

  21. Evelien & Pieterjan in New Zealand » Blog Archive » Ons adres in Google maps Says:

    […] Tsja, als je dan beetje research aan het doen bent naar applicaties voor projecten waar je aan het werk bent. Of om de weblog van wat vrienden net iets cooler te maken, kom je uit bij Inline Google Maps voor je weblog. […]

  22. Richard Brown Says:

    Hi Mike

    Using the plugin at:
    http://lostwithiel.eu/map/

    Couldn't get it to work using Camino. Mac browser based on Mozilla. Looked at it in Safari and the map loads fine! Any ideas please?

    Is it possible to have multiple points on the map?

    Thanks.

    Rich

  23. HM2K Says:

    Hi there,

    I tried out this plugin, but I was unable to get it working with http://maps.google.co.uk/ or indeed at all.

    I am using WP 2.1.2, I believe I could be overlooking something.

    Am I right in saying that all I need is a google maps URL (eg: http://maps.google.co.uk/?ie=UTF8&hl=en&q=glasgow&f=q&z=12&om=1&iwloc=addr)

    Go to a post in wordpress, and use the above link to create a hyperlink on some text?

    Then the script should do the rest and render a map?

    As I tried this, and it doesn't appear to work…

    Any ideas?

  24. Avi Alkalay :: Google Maps Plugin for WordPress Says:

    […] plugin was inspired on Macdiggs Google Maps plugin, but was completely redesigned, rewritten and made more user friendly, has cleaner code and is more […]

  25. jt Says:

    This is the best google maps plugin out of all the ones I tried to master. You Rock!!!

  26. mike Says:

    HM2K:

    you have to click "Link to this page" and only then copy and paste the resulting link into your blog. If you don't do that, there will be no latitude/longitude information in your URL and plugin doesn't support this case.

  27. Tom Says:

    Hi!

    Great plugin!

    It works fine, apart from one problem - I can't get any text to appear in the marker.

    Here's my bit of html, simply so that it says "Plug" in the marker…

    Plug

    But I just get a blank balloon.

    Any suggestions?

    Thanks,

    Tom

  28. Tom Says:

    Oops, that obviously didn't work because it activated the html as a standard link.

    But yes, I put the word 'Plug' just before the and nothing happens.

    Anyone else have the same problem?

  29. HM2K Says:

    mike, that's not really what I asked I don't think.

    I have used the hyperlink button in the wordpress visual editor with that link to create a link (using the link above) on a string of text.

    The map does not display, why? What am I doing wrong?

  30. Jay Lee Says:

    I am apparently missing something.
    I have the plugin installed and I made a post and added the hyperlink to some text as instructed, but I get no map. Just a link in the post.

    Can you help?

  31. HM2K Says:

    Still nothing.

    Mike, perhaps you can email me and we can discuss this further, in private?

    Would appreciate that, thanks.

  32. 我家在哪一條路? [JeffHung.Blog] Says:

    […] Inline Google Maps for Wordpress 蠻好用的。 This entry was written by jeffhung and posted on April 25, 2007 at 2:13 pm and filed under Life, Fun. Bookmark the permalink. Follow any comments here with the RSS feed for this post. « 近況:受傷也很快樂 […]

  33. Akubra Says:

    Thanks for the great plugin, it's working nicely. Is it also possible to set things like zoomlevel, start in Satellite or Hybrid mode?

  34. hm2k Says:

    Mike, Still not heard anything from you on this matter.

    You have made new posts since my last post, and I've contacted you by email, yet you have still not got back to me.

    Kinda disappointing really.

  35. Avi Alkalay Says:

    HM2K, try the new Google Maps plugin (inspired by Mac's plugin).

    http://avi.alkalay.net/2006/11/google-maps-plugin-for-wordpress.html

  36. centraBLOG » Blog Archive » google maps api ou comment insérer une carte sous wordpress ? Says:

    […] Mais franchement, je galère… La seule chose que j'ai trouvé, c'est le plugin Inline google map. Si j'ai bien compris, le principe étant de linker une image vers le lien d'une carte […]

  37. Chad Says:

    Doesn't seem to work in WP 2.2

  38. Todd Huss Says:

    HM2K, when people are generous enough to give away free software you spoil it for the authors by hounding them incessantly for free technical support. If you can run wordpress it's time to put on your big girl panties and troubleshoot the issue yourself! Just be glad Mike is nice enough to write and give away software, no need to expect him to provide free technical support too!

  39. HM2K Says:

    Todd, SHUT THE FUCK UP.

    What the hell are you even talking about?

    If you have any clue you'd know that I am an open source developer.

    When you produce a peice of software, you bind yourself to offer some kind of support or assistance for people to utilise it.

    I manage to resolve it myself by using someone elses (better) version, and they informed me that I was missing the &ll= part.

    Get a grip.

  40. mike Says:

    HM2K,

    first of all, you don't swear on my blog. You can go swearing somewhere else.

    I got your message but I guess I was way too busy at the time so I didn't get back to you. Well that happens, and that's why I don't sell support for the plugin. There's a version supported by Avi Alkalay you can use. That version is better supported and should work better in most cases.

    As an open source developer, you should probably know that making stuff for free don't usually pay your bills. You just create something, put your effort into sharing it with others, and try to support it to the degree you can. That's it. Someday you'll understand that anything other than that is often just not possible in reality.

    And thanks to Todd for the words of support :) I wish I could spend more time on supporting my own creations but it's just not possible at current state of affairs on my side. Doh.

  41. lesly Says:

    Doesn't seem to work in WP 2.2

  42. Lukino Says:

    I've posted this on the wrong version page of the plugin, I'm posting it again cause i think it will be usefull for many users.

    TO FIX THE BUG THAT CAUSE AN EMPTY BUBBLE TO SHOW UP WHEN THE BALLON IS CLICKED FOLLOW THIS STEPS (this fix is for 2.1 version):

    - open gmap_v2.php in a text editor

    - locate line 149, which contains: if (thehref.title=="nomap") continue;

    - AFTER line 149 add a new line (go after the "continue;" and press enter)

    - in the new line write:
    if (thehref.className=="gmnoprint") continue;

    - save the file and use the plugin, anything seems to work now.

    Thanks again to Mike for the plugins, the little time i've spent to fix it was nothing compared to how long would it take me to create the whole thing!

  43. Barry Says:

    Superthanks for the fix Lukino!

  44. Dave Says:

    Hi, great plugin.

    I have one problem i cant solve and hope you can help,I have the map working but i also have a map of the same size in the side bar.

    I have no idea what could be causing the second copy in my sidebar,tried uninstalling and reinstalling.

    Thanks

  45. Scot Hacker Says:

    Hi - We're trying to work with maps that have lots of markers, but this plugin only wants to show the center marker. I saw a reference to "one marker per map" - is that a limitation of the plugin that cannot be overcome? We really need multiple markers working. Thanks for any information.

Leave a Reply