fb pixel
Skip to main content
Login

New to DJ-Extensions?

Using OpenStreetMaps in DJ-Classifieds

Contents:

Full support for OpenStreetMaps in DJ-Classifieds component

The OpenStreetMap is a new equivalent for Google Maps. As you may know, Google recently updated its policy for using Google Maps.

This changes add limits for free usage and require users to attach their credit cards to the account, which is not accepted or cannot be processed by some organizations. Google Maps can also be limited in certain countries - so this is where OpenStreetMap steps in.

Thanks to the OpenStreetMap support you don’t have to worry about Google restrictions and do not have to provide the Credit Card information.

Configuration

DJ-Classifieds uses the Google Maps API by default. To enable OpenStreetMaps maps, you need to enable the “DJ-Classifieds - Leaflet Maps” plugin, because it is disabled by default. 
After enabling the plugin, you will have to change map provider in the global DJ-Classifieds options (as well as in map modules):
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Possibilities

Where can you display maps?

Maps can be used in various views. OpenStreetMap is supported in these views and modules:
  1. Add item view (submission form)
  2. Single ad view (click to see the demo)
  3. User profile and User profile editing views (click to see the demo)
  4. Maps modules (click to see the demo)
  5. User registration view

OpenStreetMap in DJ-Classifieds New Advert form

Map settings available during the new advert submission can be configured in the DJ-Classifieds options.
These options are available for OpenStreetMaps:
  1. Places hints in address - decide if you want to display hints in address field during the advert submission process.
  2. Allow to provide coordinates – Decide if you want to allow advertisers to add GPS coordinates during the advert submission process.
  3. The default address for coordinates map – Default address for a map where user can select coordinates
  4. Scroll wheel zooming - Scrollwheel zooming on the map during advert creation and in advert details.
  5. Maps icon – if you want to use the custom icon on maps, set it to 'custom' and put your custom icon to /images/ folder with name: djcf_gmicon.png
There is a possibility to decide whether the longitude and latitude fields in advert submission form should be used. Learn more: Hide longitude and latitude in the submission form.

OpenStreetMaps in DJ-Classifieds Advert's detail page

The information below the map, including Geographic coordinates and a reference that "Map location might not be exact."
Map settings available in the advert view can be configured in the DJ-Classifieds options.
Available options for OpenStreetMaps are:
  1. The default address for coordinates map – Default address for a map where user can select coordinates
  2. Show coordinates – Show/hide geographic coordinates under the map in advert details.
  3. Show map – Show/hide Google Map in advert details.
  4. Map img on start - show in advert details image with the button that will show map.
  5. Map Zoom – Default map zoom in advert details.
  6. Scroll wheel zooming - Scrollwheel zooming on the map during advert creation and in advert details.
  7. Maps icon – if you want to use the custom icon on maps, set it to 'custom' and put your custom icon to /images/ folder with name: djcf_gmicon.png

OpenStreetMaps in DJ-Classifieds User profile view:

Options for displaying a map on the user profile view are available in the DJ-Classifieds options, in the "Views" tab.
Learn more in the DJ-Classifieds options.
Another example. This time for the DJ-Classifieds map module:
All settings for this view are available to configure in the Maps module
We have a demo site for DJ-Classifieds, where you can check different views: OpenStreetMap version.

POI (Points of Interest) in OpenStreetMap.

One of the new features you can use with the OSM is hints (suggestions) that appear in the search module when using the Address field and the submission form. Similar to what you may know from Google Maps features when the user starts typing in one of those fields - the suggestions pulled via OSM API are displayed and can be clicked to use as a search.

Geolocation services

OSM provides the geolocation services and the "Use my location" button in the submission form of the advert or the location icon in the search module - the map (in the submission form) and location address in the address field in the search module is updated. It can be used to search by range.

Maps module parameter - "Fit items"

Using this option, the map module will display the view that will cover all the items from DJ-Classifieds. For example - if your site has adverts from all over the world - the map will be zoomed out to the whole world, but if your website is limited to some smaller location range, it will fit the zoom of the map to display all of the items from this area.

Another parameter in the maps module that works with the OSM - "Start address from geolocation" - when this is set the page where the map module is displayed will use geolocation to centre the map where the user is. This is a good solution if you want to show the items close to the user.