GoogleMap v1.4.5 – an inline Google map plugin for WordPress

GoogleMap v1.4.5 is now available with significant improvements, including

  • The Google Maps Javascript and GoogleMap Javascript is downloaded only as needed, speeding up page loading of all pages without maps.
  • Removal of <head> code means GoogleMap will only be present when called.
  • Compressed GoogleMap code.
  • Multiple maps can now be created in a single post!
  • Map type can be changed from default by providing an additional ‘map type’ parameter.

GoogleMap produces valid XHTML and allows for easy creation of Google Maps in your WordPress posts from XML map data.

Grab the latest from the WordPress repository.

Examples of the newest functionality below:

Using either: Normal, G_NORMAL_MAP, N or left out; i.e. GoogleMap(example.xml), GoogleMap will produce a default styled map

tGoogleMap(example.xml)

Using either: SATELLITE, G_SATELLITE_MAP, S; i.e. tgooglemap(example.xml, 4, S), GoogleMap will produce a satellite styled map. Note I have included a zoom of 4, and used the abreviation ‘S’.

tgooglemap(example.xml, 4, S)

Using either: HYBRID, G_HYBRID_MAP, H; i.e. tGoOgLeMaP(example.xml,hYbRiD,450,225), tGoolgeMap will produce a hybrid styled map. Note I have included a width and height, and proved that capitalisation is not of concern.

tGoOgLeMaP(example.xml, hYbRiD, 450,225)

Finally, using either: PHYSICAL, G_PHYSICAL_MAP, P, TERRAIN or T; i.e tGoogleMap(example.xml,TERRAIN), tGoogleMap will produce a terrain styled map.

tGoogleMap(example.xml,TERRAIN)

As always, comments and suggestions welcome. In a future update I will try to incorporate rounded corners 🙂


Posted

in

by

Comments

14 responses to “GoogleMap v1.4.5 – an inline Google map plugin for WordPress”

  1. Erik Harris Avatar

    This plugin just keeps getting better and better. Thank you.

  2. suapapa Avatar

    Many thanks for appling my suggestion!
    and I also needed the ‘map type’.
    Thank you!

  3. Alexander Avatar

    Hi

    thanks for your plug-in! I use it it already on some of my pages (it’s about cycling) and will use it on more pages soon!

    I found a small bug: when you have a XML file with polylines only (no markers), the variable “point” is not defined and that screws up the automatic zoom function. I could fix it by removing “bounds.extend(point);” in the section which processes the polylines.

    And… I also have a wish. Do you think it’s possible to add a parser for encoded polylines? For example, if you would have something like this in the XML file:

    I don’t know if the contents of the XML file are standardized and if that is possible at all. But, I think it would increase the speed of drawing longer polylines into a map.

    Greetings!
    Alexander

  4. MECTILE Avatar
    MECTILE

    Hi Alex

    Thanks for the bug report, it has been fixed with version 1.4.5.1.

    Please explain your parser idea, I think your example was removed.

    Travis

  5. Alexander Avatar

    Hi

    that was very quick fix!

    Here is my example again (a bit modified). I hope it goes through this time:

    colour=”#3333cc”
    width=”4″
    encodedPoints=”sq|fGhmpaNqBhRoeCyF”
    encodedLevels=”BBBBBBBBBBBBBBBB”

    The idea is to have a section in the XML file with the values for EncodedPoints and EncodedLevels.

    Here is a page with some information about encoding polylines: http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/index.html
    There is also a tool on this page which encodes KML or NMEA files from the GPS logger.

    Greetings!
    Alexander

  6. MECTILE Avatar
    MECTILE

    Hi Alexander

    Thanks for the info, I did not know about Encoded Polylines.
    It is an interesting concept.

    I will look into it. At the moment I want my plugin to handle gpx files, using Encoded Polylines has the advantage of smart line drawing, I might be able to incorporate both.

    Travis

  7. Alexander Avatar

    Sounds good! Thank you!

  8. charismeki Avatar
    charismeki

    hi travis,

    any clue why the markers dont show up? nice pluign btw. the map appears on my webpage. i am using the example.xml which is located in the tGoogleMap folder

    thx and best

  9. MECTILE Avatar
    MECTILE

    charismeki,

    can you provide a like to your site with the example?

    do you have the marker directory copied and uploaded?

  10. Michalis Avatar
    Michalis

    Is it possible to use an .klm file from google maps? So, if I update a personal map from “My Maps”, then it is not necessary to download and then upload the file again.

    1. MECTILE Avatar
      MECTILE

      klm files are currently not supported, only xml files at the moment.

  11. Paul Avatar
    Paul

    Hi, I’m trying to use your Google Map plugin with my experimental WordPress website and receive the following message:

    The Google Maps API key used on this web site was registered for a different web site. You can generate a new key for this web site at http://code.google.com/apis/maps/.

    I already have an API key for this domain but I’ve tried different URL settings for the API key but they all result in the same message. What am I doing wrong?

    Thank you
    Paul

  12. Paul Avatar
    Paul

    Hello again, Since that last message I’ve discovered that I am unable to successfully use any map utilities and the one plugin I did get to work had problems with display. I changed the theme and there seems to be no problem. The theme that gave me the problem was Atahualpa and although it is a superb and flexible theme, I suspect it doesn’t work well with some plugins so I shall reserve it for a less demanding application.
    Thank you again for an excellent plugin.
    Paul

    1. MECTILE Avatar
      MECTILE

      Paul, Glad to hear you have found the problem. Let me know if you run into any other issues.

Leave a Reply

Your email address will not be published. Required fields are marked *