This tutorial explains how to display Google map for ads with address custom field on Classibase classifieds script. Map is useful for property, service and job listings. There are several settings to complete in order to display Google maps. These steps are already set by default for fresh Classibase installs using version 1.4 or later. If you are upgraded from older version then you may have to complete all of the following steps.
Create address custom field and add address custom field to category following tutorial about adding custom fields.
Enable Google maps
Classibase uses Google maps API to display address on map. You can use it free for sites displaying 25000 maps requests daily. In case you exceed that limit you can purchase additional usage from Google and insert API key in map settings page. Follow these steps to enable Google maps for classifieds website:
- Navigate to “Settings” -> “Ads” page on admin panel
- Select “Display map for ads” checkbox if not selected
- Select “Display map for old themes” checkbox if not selected. This is usually used for current themes. It will add map code after item description on ad page. If you have specific place in your theme for map then map will be displayed on that location, otherwise map will be displayed after item description.
- Adjust map “Zoom level” from corresponding text field. Zoom level 14 usually will display street level map. You can use value between 0-18 for this field.
- “Google maps API key” text field is for inserting your API key if you got one. Usually for small sites you will not exceed 25000 map requests per day limit. Learn more about Google Maps API usage limit click here.
There are some cases when Google map will not show up on item page:
- If no address custom field defined for ad
- If address custom field is empty
- If Google cannot find given address and position it on Google map