Knowledge Base - Advanced Features Guide

Working with directories and categories


This article explains how the Geocode Factory works with categories. Geocode Factory can draw maps, and populate them with data from different products (Community Builder, Sobi2, Sobipro, Mosets tree, ...). For directory components there are some special requirements.


Each directory entry needs to be geocoded (from the address ... city, street, ...). This means each directory entry needs to have latitude / longitude associated with it. Some components are capable of geocoding entries during the creation process, some need a 3rd party plugin. In addition, Geocode Factory can batch geocode all entries (or all non geocoded entries), from the backend.

Geocode Factory works with directory components like : Sobipro, Sobi2, Adsmanager, Joomla! content, GPSTools and Mosets tree. We provide many features related to these components :

  • filter the map markers based on the current category
  • display the markers icon based on the current category
  • display the markers icon based on the entry
  • center the map on current entry in detailed view

Of course the Geocode Factory maps can be used for standalone maps as well, and include all existing markers from these directory components (and/or community profile components, and/or event components).

Add a map in component category

It's possible to have a map displayed within a directory component as a contextual map. The goal of the present chapter is to create a Geocode Factory map displayed within your directory listing page. To display a Geocode Factory map into the directory context, we need to publish the map as module. See the module related articles from the getting started guide. In summary you need to :

  • Create a basic map in Geocode Factory. Don't forget to add a basic template (at least [map])!
  • Setting the map center as “all markers” option is a good idea here, then in all categories, the map will show all available markers.
  • Create a basic markerset in Geocode Factory without filters or radius (you can add them later). Don't forget to add something to the template like [TITLE] so the bubble has something to display.
  • Link the markerset to the map
  • Test your map to be sure it displays all your markers
  • Create a Geocode Factory menu link in Joomla! for testing. Select the show maps by it’s ID, and select the map.
  • The map is shown on front-end and you see all markers.
  • Configure the "Geocode Factory - Show Map module"
  • Set the created map in the module parameters
    • publish the module on your directory pages (sample : on the Sobipro pages)

Now you will see a map on your directory home (and other) pages. This is good, but in this case we want to filter the map to show only the markers from the current category.

Filtering the entries (markers) by category

Now we can filter the markers based on the categories. There are 2 methods. Either method allows you to mix the markersets from directories with markersets from other types of extensions. (Jomsocial profiles, etc). This means, you can display all users' profiles or event markers, and in the same map, the directory markers, filtered by category.

Method 1 : Manually filtering categories

This method can be used in any context, not only with directory pages. It can also be used when the map is not published on directory pages at all. A great technique is the usage of markerset selection list or a markerset checkbox selector. The concept is to create a markerset for each category of the directory for the maximum versatility :

  • Create one map
  • Create one markerset for the first category (or parent category)
    • set a name based on the category
    • set a custom icon based on the category (you can also use the automatic icon from category or icon from entry, see below)
    • in the Data source tab of markerset editor, select the needed category
  • Repeat this for each directory category
  • Attach each markerset to the same map
  • Load the map and you will see all markers (of all categories)
  • In addition if you set the [sidelists], [selector], [multi_selector], or [toggle_selector] (check box) controller in the map template you will see those controls as well.
  • The user can select what markerset to display

Note : you can also only create the markersets for the parent categories, in this case, simply select the child category at same time as the parent (multi-select)


Method 2 : Automatic filtering based on current category

This solution is 100% automated, and is very useful if you are using the directory components built in category navigator to navigate in the categories. With one map, 1 markerset, and 2 minutes, you can create a map that displays the markers based on the*current* category and with that category’s icon.

  • Create one map
  • Create one markerset
    • set a name
    • set a custom icon (you can also use the icon from category or icon from entry, see below)
    • in the Data source tab of markerset editor, enable the Auto-cat option
  • Load the map and see all markers (of all categories)
  • Publish the map into the Geocode Factory - Show map module on the directory pages (see above)
  • When the user browses the categories of the directory component, the map (in the module) will show only the markers from the current category (also child categories), and the icon can be automatic.

Note : in this case you cannot use a markerset selector, because all markers are displayed from one unique markerset.


Show a Geocode Factory map in a directory entry

In the directory component you always can see a detailed view. For example, in the category named “hotel”, you will see a list of hotels and if you click on a hotel entry, you will see the hotel detail, like address, photos, and description. Here the Geocode Factory map can also be used to show the current entry position.
When an entry is chosen by the user, the Geocode Factory map will always try to zoom in on the current marker.

  • Create one map
  • Create one markerset
    • set a name
    • set a custom icon (you can also use the icon from category or icon from entry, see below)
  • Load the map and see all markers (of all categories)
  • Publish the map into the free module on the directory pages (see above)
  • Into the module select the zoom level :
    • 0 = use the automatic zoom, based on viewport
    • 1 to max : force the zoom in a specific level
  • When the user browses any entry of the directory component, the map (in the module) will zoom on the marker.

This view is the category view, where you see all entries from the current category, and on the left is the Geocode Factory map (in module position) :


This view is the entry view, where you see the position of the current entry. On the left, is the same map, with the same markerset, but automatically centered on the current entry marker, with a different zoom. (customizable in module) Other markers are also present on the map :



Show a Geocode Factory map in a Sobipro entry


With Geocode Factory is possible to show a map near or within a Sobipro entry. For either solution you need to configure the Geocode Factory - Show map module. If you want to display the map into a module position, you can use the method describe above, and if you need the map within the entry (even entry tabs) follow this process :

  • Create a Geocode Factory map
  • Create a markerset with all entries
  • Show this map within the Geocode Factory - Show map module
  • Publish this module in a hidden position
  • Add this line in your Sobipro template :

NOTE : if you have less and fixed number of Sobipro entries, you can create one markerset by entry...

Marker icons with categories

You can define different type of icons for your markerset.

Normal icon

Use a custom icon, a map icon, or a predefined icon. This is not related to a category, and is not automated for categories.

Entry icon

In the markerset editor, on the marker icon tab, select the “Logo/Avatar” option, then the icon image will be the icon of the entry.

Category icon

You can show each item with the directory component category icon on a geocode factory map.

  • First of all you need to make sure that each category is configured to have a icon.
  • Configure the markerset(s) to show the category icon as the marker on the map. Go to the markerset manager and select a markerset or create a new markerset. Choose yes where you can select Category as icon.
  • Enable Category as icon, overrides the selected marker image.
  • Make sure each category is configured with a icon. If not, the item is not shown on the Geocode factory map, where Category as icon is enabled.
  • An item can be in more than 1 category. On a map where there are more than 1 categories shown, only 1 marker for each item is shown. This will be the marker of the first category.
  • When you load the map all the items are shown with the corresponding category icon. Items in categories, which are not configured to show a icon, are not shown on the map.

This works as well with maps that use a marker set where Auto categories is enabled.

When you load a main category, the icons of the items in the subcategories are shown.

Sobipro sample, here you set the category image :


Here you see the main map, from the top category :


Here you see the markers when you browse into a child category :


Multiple markersets with different icons

Imagine that we have a map that contains several markers. Each item can have some information like a checkbox "Instruments : drum, guitar, bass, piano".

Now you can create 4 markersets, one for each instrument (Bands with drummers, Bands with guitarists, ...) based on a filter on the Instrument field, with each its own marker icon (drum, guitar...). Now we create a Band entry with the options Drum and Bass.

In the map manager there is a option named 'Duplicate markers' with 3 options :

  • Display one strict (if no frontend markerset selector) : Show each marker only once. Our entry will only appear in the first Drummer's markerset. This option is designed to save resources if you don't allow the frontend user to select markersets.
  • Display one (show in each markerset and one in ALL options) : will show the entry in the Drummers, Bassists and All. In the all option one marker is shown for John, and the first icon, and first bubble templates are used (You can set it as first in the markerset order).
  • Display all (marker shown in each markerset and each in ALL option) : will be shown on the map in the 2 markerset, and 2 times (for the 2 entries) in the All option. In this case the 2 icons are on the same place, and you can use the medium or low accuracy to have a better looking result.

You can see a real working sample in this Geocode Factory case study and in this capture we have select in the listbox (not visible on capture for customer privacy) the -All- option :


And in this capture the Babysitter option :


Applies To

Geocode Factory 3, Geocode Factory 5