This is homepage for CleanCodeNZ Geo Posts WordPress plugin
The plugin is using custom post type plus google maps api v3 to allow admin to enter custom posts with geo locations then display them on a google map as markers overlay, when individual markers are clicked, an info window will be displayed with the posts content.
The plugin is highly customizable that you can use it to build map functions into your wordpress site like a store locator, real estate listing, or photo spots which is presented here as a demo, etc…
The custom post type is defined with
1. Image field which can be embedded in the pop-up when markers are clicked.
2 .Icon image field which is used for markers image, the image used for icon is automatically resized to 32X32
3. Address field which then can be translated into geo coordinates using geo finder that comes with the plugin.
4. Category field, which can be used to group geo posts into difference categories.
Installation of Plugin
1. Upload this directory to your plugins directory. It will create a ‘wp-content/plugins/cleancodenzgeoposts/’ directory
2. WordPress users should go to their Plugins page and activate “CleanCodeNZ Geo Posts Plugin”.
3. Now go to Settings->CCNZGeoPosts, enter the default zoom level, latitude and longitude for Google maps, and title of the page you want the map on
4. Now go to Geo Posts->Add new, these posts should appear on the map of the page you have set in step 3
5. Then browse to your map page whose title you have entered in step 3 to see those posts you entered in step 4 to appear on map, have fun.
Title of Map Page: is the title of the page that is going to show the map with geo posts. So all the scripts and functions that come with this plugin ONLY activated when Map Page is being displayed.
As this is using custom post type, so ‘Geo Posts’ will be accessible from left menu.
4.1. Image: is the image that will be embedded in pop-up, together with post content, integrated with built in media library
4.2. Location field: this can be used to find the geo coordinates
4.3. Lat and Lon fields are used to locate geo posts on the map
4.4. Category: It is customizable
4.5. Marker image: the plugin will add new image size to media library, 32X32, when you select ‘Google Marker Image’, the 32X32 version of image will be used.
Tick the box ‘Google Marker Image’
1. How Can I Change Category:
Plugins-> CleanCode NZ Geo Posts Plugin-> Edit-> geoposts-config.php
You can change the name and icon for existing categories, add new categories
2. How Can I change category icons:
You can either upload the different images with same name to override default icons, or change icons settings in getAllCategories to new images
3. How can I change styling of map:
Plugins-> CleanCode NZ Geo Posts Plugin-> Edit-> geoposts.css
4. How Can I add new fields to Geo Posts type:
Plugins-> CleanCode NZ Geo Posts Plugin-> Edit->geoposts-config.php
getGeoPostsTypes(), you can change and add new fields to geoposts.
Supported field types: image, geolocation, geolatitude, geolongitude, select, markerimage
5. Can I use the same image for both marker overlay and content:
Yes, for marker image, you need tick ‘Google Marker Image’ in your media library, images you uploaded before this plugin is installed, they do not have 32X32 version, so just be aware of that, instead the 32X32 of top left corner of bigger image is taken as the icon
6. How Can I change the content of popup?
Plugins-> CleanCode NZ Geo Posts Plugin-> Edit-> cleancodenzgeoposts.php, find following code. You can change the following line, if you need css, you can add css entries in geoposts.css.
available fields are all fields from geo posts plus content field which is the content of geo post.
$content ='<div>'. '<h1>'.$gp['title'] .'</h1>'. '<div><img src="'.$gp['gp_1_image'] .'"/></div>'. '<div>'.$gp['content'] .'</div>'. '</div>' ;
In this version fast proximity and category search is supported.
1. Premium Option page:
Two new options:
Search Layout: if it is turned off, there will no search on map page
Use Miles: when search layout is turned on, the default units for distance is km, you can change it to miles by ticking this box.
2. Premium Data entry:
No change at all. if you have been using free version, you will need to bring up your geo post and save it in order for proximity search engine to index your geo posts, for new geo posts, it will be indexed automatically.
3. How to use search:
3.1. In the input box enter the central point you want to search from, then click ‘Go to location ’.
You can also pan the map to where you want it to be, the proximity search is based on the central point of map.
If you enter an address and forget to click ‘Go to location’ the map has not moved, so the search will be performed against current map centre, make sure click ‘Go to location’ if you want to nominate a central address.
3.2. enter a numerical number in within box as search radius
3.3. click ‘Search locations’
The results will be listed in a list above map, sorted by the distance, searched locations also have markers on the map.
3.4. Google map ApI key:
Currently there is no API key used, if your website uses map more than the free quota that comes with no API key, you might need an API key for map to continue to function.
Demo: Photo Spots Of New Zealand, a demo of this plugin.
I used this plugin to upload and display photos I have taken around New Zealand during holidays on a map that you can click to see the photo and details of the place.