thydzikGoogleMap version 1.4 has been released with two major improvements.
- Manual zoom parameter added. Google uses an integer value from 0 to 17 (where 0 is the furthest away), to determine the map’s zoom level, this value can now be incorporated into thydzikGoogleMap as follows: thydzikGoogleMap(example.xml, 4). The zoom is an optional parameter and if left out the automatic zoom calculation will be used as before. The width and height of the map can still be added if desired as thydzikGoogleMap(example.xml, 4, 480, 640) or thydzikGoogleMap(example.xml, 480, 640, 4).
- The thydzikGoogleMap code is disabled if the site is viewed from a proxy, i.e. Google cache. Before a user viewing the blog would receive ‘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/.’ thydzikGoogleMap now detects this and disables the maps.
Example with the new zoom functionality
Future improvements will include
- Option of choosing Map, Satellite or Terrain
- Disabling all code if no thydzikGoogleMap are present
- Creating multiple maps in a single blog post
Grab the latest from the WordPress repository.
thydzikGoogleMap v1.3.1 has been released, with 2 improvements.
- Fixed a problem with cross domain xml files. As reported by Erik on thydzikGoogleMap support forum.
- Added improved output for when directly calling thydzikGoogleMap.php
Before Google bots would have picked it up as
Fatal error: Call to undefined function get_option() in /home ...
Now Google will see:
thydzik.com are proudly using the WordPress plugin thydzikGoogleMap
to display inline Google maps on their blog.
Where thydzik.com is the WordPress user’s domain including link.
Finally, a small note about upgrading thydzikGoogleMap. WordPress has the option of automatically upgrading, which is very handy; unfortunately this overwrites any XML files you may have been storing in the plugin directory. So it is a better idea to keep all your XML maps in a separate location.
thydzikGoogleMap version 1.3.1
I have finally managed to get WordPress to update the version number. This problem was due to not updating the version number in the PHP file as well as the readme.txt.
Version 1.3 fixes a problem with thydzikGoogleMap not displaying correctly when a WordPress blog isn’t located in the domain folder.
I have seen a few users, using thydzikGoogleMap to display a single point or no points at all, thydzikGoogleMap isn’t really for this as it is not worth creating an XML file just for the single point. Plus I believe you can now simply embed a Google map with some simple code.
However, if you want full customization; including lines, numbered points, HTML in a point’s detail, then thydzikGoogleMap is exactly for you.
Comments and suggestions very welcome.
Download thydzikGoogleMap v1.3
From time to time I would like to share some of my Australian travels. It doesn’t really fit in technology or projects. Karratha is 1535km north of Perth, Western Australia.
The XML for the map below was made with RoboGEO, which synchronises GPS data with photographs using the timestamp. The XML map data was then displayed as a Google map using my WordPress plugin thydzikGoogleMap.
One of the features of thydzikGoogleMap is the ability to show XML Google maps, while maintaining the internal links to photographs.
Here is a quick post on how to add a URL link to your WordPress header. This has only been tested on the default theme. You will need to know the dimensions of the header; the default header is 760px by 200px. Note, you will need to disable Toggle Text Display, in WordPress Admin→Presentation→Header Image and Color→Advanced→Toggle Text Display.
Simply add the following code into header.php after
<a href="<?php echo get_option('home'); ?>/" style="display:block;height: 200px;width: 760px"></a>
With it inserted should look like the following:
<div id="header"><a href="<?php echo get_option('home'); ?>/" style="display:block;height: 258px;width: 760px"></a>
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="description"><?php bloginfo('description'); ?></div>
An example blog with a linking header.
thydzikGoogleMap is a WordPress plugin that creates inline Google maps in your WordPress posts. There are two main advantages over other existing Google maps plugins and they are:
- Ease of use, to create a Google map simply type thydzikGoogleMap(mapdata.xml, 600, 480) in your post on its own line.
- thydzikGoogleMap uses XML map data, this allows for maximum configurability, and supports multiple points and lines.
Please note, this is my first attempt at any ‘real’ php coding and my first attempt at creating a WordPress plugin. I am pretty sure I have not coded things optimally, the main thing is it does work. I have tried to minimise the return of errors and the plugin not working. Comments welcome on any suggestions or bugs.
- a markers folder is included with numbered pointers, these are used only when icon=”x” (where x is an integer), if this is excluded or pointers are alphabetical default Googles pointers will be used.
- if width and height is excluded, the default width and height (460 and 345 respectively), found in the configuration page will be used.
- thydzikGoogleMap automatically centres and zooms in on the points and lines, this may not always give the best results.
- thydzikGoogleMap will produce a Google map only if the XML file is found, this was made so that examples i.e. thydzikGoogleMap(mapdata.xml) could be posted without producing a Google map.
- Only 1 Google map per post with be converted, however, multiple maps can exist when multiple posts are displayed.
- thydzikGoogleMap produces valid XHTML.
- thydzikGoogleMap has only been tested on the default Kubrick theme, WordPress version 2.3.2.