Lets the visitors of your LaraClassifier / JobClass site search the listings on a map: around their position, inside an area they draw, or wherever they move the map. Sellers place their listing with a pin, and you decide how precisely the public sees it.
Map Results View
A page with the list of results on one side and the map on the other. Nearby markers are grouped, and the results follow the map as the visitor moves or zooms it.
Near Me & Draw an Area
One click searches within a radius of the visitor's position. The visitor can also draw any shape on the map, with the mouse or a finger, and get the listings inside it.
Two Map Providers
OpenStreetMap (Leaflet), which needs no API key, or Google Maps with the key already saved in your settings. You switch from the Admin panel.
Location Privacy
Sellers pin their listing in the posting form. The public sees the exact pin, an approximate area or only the city, as you choose. A private address never leaves the server.
How It Works
- Sellers locate their listing. The posting form gets a location block: an address field and a map with a pin. It is optional: a listing without a pin is located on its city, as before.
- The add-on computes a public point. Depending on the privacy level, it is the pin itself, a point shifted at random inside a circle around the pin, or the city. Only this public point is stored on the listing. The real pin is kept in a separate table and never sent to visitors.
- Visitors search on the map. The map page shows the listings of the current country, with the same keyword and category filters as your results page. Near me and Draw an area narrow the search to a circle or a shape.
- The listing page shows where. A small map shows the pin, a circle or the city, according to the same privacy level.
Requirements
- LaraClassifier / JobClass v19.1.17 or later
- PHP 8.3+
- MySQL 8.0+ or MariaDB
- A site served over HTTPS for the "Near me" search: browsers do not share the visitor's position with plain HTTP pages
- For the OpenStreetMap provider: outgoing HTTPS requests allowed from your server (address search), which is the case on almost every host
- For the Google Maps provider: a Google Maps Platform API key with the Maps JavaScript API and the Geocoding API enabled (see Google Maps)
Installation
Step 1: Upload the add-on
Go to Admin panel → Extensions → Add-ons, click Upload add-on and drop the add-on's .zip file into the upload area (50 MB maximum).
The archive is extracted into extensions/addons/mapsearch/ and Map Search appears in the list, deactivated.
extensions/addons/mapsearch/ over FTP or SSH: its addon.json file must sit directly inside that folder.
Then open Admin panel → Extensions → Add-ons. The page scans extensions/addons/ every time it loads, so the add-on is listed straight away (the Sync button runs the same scan on demand).
Step 2: Activate the add-on
Click Activate on the Map Search card. It is a paid add-on, so a dialog asks for its purchase code, which is verified before anything else happens: an invalid code is rejected in the dialog and nothing is changed.
Once the code is accepted, activation runs in one pass: it creates the add-on's database tables (its migrations), registers its permissions and publishes its public assets. Reload the page to see its new entry in the Add-ons section of the admin sidebar.
Step 3: Configure
Open Admin panel → Map Search from the Add-ons section of the sidebar and set the add-on up: see First Steps.
Purchase Code (License Key)
Map Search is sold as a separate product, so it has its own purchase code (license key), distinct from the purchase code of the main application and from the one of every other add-on. You are asked for it when you activate Map Search in Admin panel → Extensions → Add-ons.
Our products are sold on three platforms. The way you receive a purchase code depends on where you bought the product.
| Platform / Marketplace | How you get the purchase code | Where to find it again |
|---|---|---|
| bedigit.com Store In-site purchase (Shop) |
Generated automatically when the order is paid, then sent by email, either in its own license email, or inside the order confirmation email. | My Account → My Licenses on bedigit.com |
| Gumroad | Created as soon as Gumroad notifies us of the sale, then sent in a separate email, in addition to the Gumroad receipt. | The license email, your Gumroad Library, and My Account → My Licenses on bedigit.com |
| Envato Market CodeCanyon |
Issued by Envato, not by us, and never sent by email: you download it yourself from your Envato account. | Envato account → Downloads → License certificate & purchase code |
1. bedigit.com Store (in-site purchase)
- As soon as the order’s payment status becomes Paid, a license key is generated automatically for every licensed item in the order (one key per purchased unit: buying 3 units gives 3 distinct keys).
- It is emailed to the address used on the order, either in a dedicated license email or inside the order confirmation email. Check your inbox and your spam / junk folder.
- The key stays available in your account under My Account → My Licenses. Keys are masked in the list; open the license detail page to reveal and copy the full key, see the domains it is activated on, and deactivate a domain to free an activation slot.
- The matching invoice is under My Account → My Orders.
2. Gumroad
- A Gumroad purchase produces two separate emails: the Gumroad receipt (sent by Gumroad, giving access to the files) and a license key email (sent by bedigit.com) that contains your purchase code.
- The license key email is generated as soon as Gumroad notifies us of the sale, so it normally arrives within seconds of the payment. Here too, check your inbox and your spam / junk folder.
- When the Gumroad product uses Gumroad’s own license-key feature, the same key also appears in your Gumroad receipt and under Library → your purchase on gumroad.com.
- Use the same email address on bedigit.com as on Gumroad: your keys are then linked to your account automatically and listed under My Account → My Licenses, even if you register after the purchase. You can also add a Gumroad key manually from My Account → My Gumroad Licenses.
3. Envato Market (CodeCanyon)
- Envato purchase codes are issued and delivered by Envato Market, never emailed by us, so there is nothing to look for in your spam folder: you retrieve the code from your Envato account.
- Log in to your Envato / CodeCanyon account, open the Downloads page, find the item, and choose License certificate & purchase code from the Download dropdown. The code is written in that certificate.
- An Envato purchase code looks like
12345678-90ab-cdef-1234-567890abcdef(8-4-4-4-12 characters). It never changes, and renewing item support does not issue a new one. - Official Envato article: Where Is My Purchase Code?
First Steps
- Choose the map provider. OpenStreetMap is selected by default and works at once. To use Google Maps, save your API key in the core settings first, then select it in Map Search → Map provider (see Map Providers).
- Choose the privacy level. By default the public sees an approximate area of 500 m. Change it in Map Search → Locations and privacy before your sellers start placing pins (see Location Privacy).
- Open the map. The Open the map button of the settings page opens
/map-searchon your site. A Map button is also added to the toolbar of your results page. - Link to the map. Add
/map-searchto your menus from Admin panel → Menus if you want it in the header or the footer.
The Map Page
The page is at /map-search (with the language prefix when the "Localized URLs" option of the application is on). On a computer the list is on the left and the map on the right; on a phone the map comes first and the list follows.
| Element | What it does |
|---|---|
| Keyword and Category | The same search as your results page, limited to the main categories. The Map button of the results page carries the current keyword and category over. |
| Go to a place | Moves the map to a city, a district or an address typed by the visitor. The search runs when the visitor presses Enter or the arrow. |
| Near me | Searches within a radius of the visitor's position. See Near Me. |
| Draw an area | Searches inside a shape drawn on the map. See Draw an Area. |
| Search as I move the map | Ticked by default: every move or zoom searches the visible part of the map. Unticked, the results stay as they are while the visitor looks around. |
| Markers | A pin is a listing with an exact position, a dot is a listing with an approximate one, and a numbered circle is a group. Clicking a group zooms into it, or lists its listings when they share the same position. Clicking a pin or a dot opens the listing's card. |
| List | The listings found, 20 per page by default, with their picture, price, city and date. Each card opens the listing. |
The map shows the listings of the country the visitor is browsing, like the rest of the site. When a search finds more listings than the marker limit, only the most recent ones are shown and a message invites the visitor to zoom in.
Near Me
The Near me button asks the browser for the visitor's position, then shows the listings inside a circle around it. A Within selector appears to change the radius; its choices go up to the maximum radius you set. Clear the area returns to the normal search.
- The browser asks the visitor for permission the first time. If they refuse, a message explains how to allow it.
- The position is used for this search only. It is sent to your server as coordinates in the search request and is not stored.
- The address of the page keeps the point and the radius (
?near=...&radius=...), so the search can be bookmarked or shared.
Draw an Area
After a click on Draw an area, the visitor holds the mouse button (or a finger) and draws the outline of the area. On release, the shape is closed and the listings inside it are shown. The Esc key cancels the drawing, and Clear the area removes the shape.
A shape that is too small to be meant (a simple click) is ignored. While a shape or a "near me" circle is active, moving the map does not change the results.
Location in the Posting Form
A Location on the map block is added under the City field of the form used to post and to edit a listing. It is optional.
| Element | What it does |
|---|---|
| Address and Find | The seller types a street address and clicks Find (or presses Enter). The pin is placed on the best match, and the other matches are listed to choose from. The selected city is added to the search, so a short address is enough. |
| Use my current position | The target button places the pin where the seller is. |
| Map | A click places the pin and a drag adjusts it. The map opens on the selected city. When the address field is empty, it is filled with the address found at the pin. |
| Remove the pin | The listing goes back to the position of its city. |
| Show my exact address and pin on the listing | Shown when you allow it and the privacy level is not already exact. Meant for shops and businesses that want to be found. |
A line under the map tells the seller what buyers will see, according to your privacy level.
Map on the Listing Page
The Location map card of the listing page shows, depending on what the public may see:
- the exact pin and the address;
- a circle for an approximate location, with a note saying that the seller will share the exact address;
- the city, for a listing without a pin or when you show cities only.
It replaces the embedded Google map of the application (Settings → Listing Page), which is always exact and needs a Google key. Switch Map on the listing page off in the add-on's settings to keep the application's own map.
Admin: Settings
Open Admin panel → Map Search, in the Add-ons section of the sidebar. The page has four tabs and one Save button.
General
| Option | Default | Description |
|---|---|---|
| Enable Map Search | On | Master switch. Off, the map page answers "not found", and the Map button, the location block and the listing map disappear. The pins already saved are kept. |
| Map on the listing page | On | Replaces the application's embedded map on the listing page. See Map on the Listing Page. |
Map provider
| Option | Default | Description |
|---|---|---|
| Map provider | OpenStreetMap (Leaflet) | OpenStreetMap or Google Maps. Google Maps can only be saved once an API key is in the core settings; a banner at the top of the tab tells you whether one is, with a link to that setting. |
| Tile server URL | https://tile.openstreetmap.org/{z}/{x}/{y}.png |
Where the map images come from with OpenStreetMap. Must contain {z}, {x} and {y}. Leave it empty to restore the default. |
| Map attribution | © OpenStreetMap contributors | The credit shown in the corner of the map. Change it together with the tile server. |
| Address search service | https://nominatim.openstreetmap.org |
The service that turns an address into a position with OpenStreetMap. Any Nominatim-compatible API works. |
The last three options are only used by the OpenStreetMap provider.
Search
| Option | Default | Description |
|---|---|---|
| "Near me" search | On | Shows the Near me button. |
| Default radius | 10 km | Radius of a "near me" search before the visitor changes it. Cannot exceed the maximum radius. |
| Maximum radius | 200 km | Largest radius offered in the Within selector (1 to 1000 km). |
| Search by drawing an area | On | Shows the Draw an area button. |
| Group nearby markers | On | Markers close to each other become one numbered marker until the visitor zooms in. Off, only the listings sharing the exact same position are grouped. |
| Most markers per search | 1000 | Beyond this number (50 to 5000), only the most recent listings are sent to the map. Lower it if the map is slow on phones. |
| Listings per page | 20 | Size of a page of the list next to the map (5 to 60). |
Locations and privacy
| Option | Default | Description |
|---|---|---|
| Location in the posting form | On | Shows the location block. Off, sellers can no longer place or move a pin; the pins already saved stay. |
| What the public sees | Approximate area | Exact pin and address, Approximate area or City only. See Location Privacy. |
| Radius of the approximate area | 500 m | Size of the circle shown for an approximate location (50 to 5000 m). |
| Sellers can show their exact location | On | Adds the "Show my exact address and pin on the listing" checkbox to the posting form. |
The tab also tells you how many listings have a pin. Saving a change to one of the last three options recomputes the public location of all of them at once, which can take a moment on a site with many pinned listings.
Map Providers
OpenStreetMap (Leaflet)
Free and without an account. The Leaflet library is shipped with the add-on, so nothing is loaded from a third-party script host; only the map images and the address searches come from outside.
- Map images. The default tile server is the public one of the OpenStreetMap Foundation. It is meant for light traffic and has a usage policy. For a busy site, subscribe to a tile provider (many offer a free tier) and paste its URL and attribution in the settings.
- Address search. Addresses are found through Nominatim. The requests are sent by your server, which identifies your site, and each answer is cached for 30 days. In keeping with the Nominatim usage policy, the search runs when the user presses Enter or a button, not while typing, and each visitor is limited to 20 address searches per minute.
Google Maps
- In the Google Cloud console, enable the Maps JavaScript API and the Geocoding API on your project, with billing set up.
- Create an API key and restrict it to your domain (HTTP referrers).
- Save the key in Admin panel → Settings → Others → Google Maps, field Maps JavaScript API Key.
- Select Google Maps in Map Search → Map provider and save.
With Google Maps, the address searches are made by the visitor's browser with that same key, so the tile server and address search options are not used. Google bills map loads and geocoding requests according to its own pricing.
Location Privacy
| Level | On the map and the listing page | Address |
|---|---|---|
| Exact pin and address | The pin, where the seller placed it. | Shown on the listing. |
| Approximate area | A circle of the radius you set, around a point shifted at random. The real pin is always inside the circle and never at its center. | Private. |
| City only | The position of the listing's city. | Private. |
When Sellers can show their exact location is on, a seller who ticks the checkbox of the posting form gets the first level for that listing, whatever the level you chose.
- The real pin stays on the server. When a location is not exact, the pin and the address are kept in the add-on's own table. The listing itself, the pages, the map searches and the application's API only carry the public point.
- Searches use the public point. A "near me" circle or a drawn area tests the shifted point, not the real one, so nobody can narrow down a private address by repeating searches.
- The shifted point is stable. It is drawn once and kept for as long as the pin does not move. Saving the listing again does not produce a new one.
- Changing the level applies to everyone. The public location of every pinned listing is recomputed when you save the settings.
Custom Themes
The map page works with any theme. The three blocks the add-on puts on your own pages are included by the theme, and the themes shipped with the application (from v19.1.17) already contain these lines. If you use a theme of your own or an older copy of a theme, add them to its views:
| Block | View of the theme | Where |
|---|---|---|
| Map button | search/results.blade.php |
In the toolbar, next to the sort menu. |
| Location block | listing/createOrEdit/create/listing.blade.phplisting/createOrEdit/edit/listing.blade.php |
After the city field. |
| Listing map | listing/show/partials/sidebar.blade.php |
Where the map card must appear. |
Map button. Rendered as a list item by default; pass ['msWrapper' => 'none'] when your toolbar is not a list.
@includeWhen(addon_active('mapsearch') && view()->exists('mapsearch::search.button'), 'mapsearch::search.button')
Location block. The city field must keep the id cityId, or pass its selector as 'citySelector' => '#myCity'.
@includeWhen(addon_active('mapsearch') && view()->exists('mapsearch::form.location'), 'mapsearch::form.location', ['listing' => $listing ?? null, 'listingInput' => $listingInput ?? null])
Listing map. The view renders nothing when the option is off or the listing has no position.
@includeWhen(addon_active('mapsearch') && view()->exists('mapsearch::listing.map'), 'mapsearch::listing.map', ['listing' => $listing])
The add-on's styles use the Bootstrap 5.3 variables of the theme (colors, borders, dark mode), and its markers take the theme's primary color. Your layout must render the after_styles_stack and after_scripts_stack stacks, as the shipped themes do.
Advanced Options
A few values have no field in the Admin panel. To change one, create the file config/mapsearch.php in your application with only the keys you want to override, then run php artisan optimize:clear if your configuration is cached.
<?php
return [
'card_cache_ttl' => 300,
'max_pin_distance' => 50,
];
| Key | Default | Description |
|---|---|---|
card_cache_ttl |
600 |
Seconds the cards of the list and of the popups are kept in cache. A change of title, price or picture shows on the map after this delay. 0 turns the cache off, which makes every search slower. |
max_pin_distance |
150 |
Kilometers. A pin farther than this from the listing's city is ignored. 0 accepts any pin. |
max_area_points |
200 |
Most points kept for a drawn area. A longer drawing is simplified. |
geocoder_cache_ttl |
2592000 |
Seconds an address search is kept in cache with OpenStreetMap (30 days). |
Permissions
The add-on has a single admin page, its settings, and uses the application's own settings permissions. It adds none.
| Permission | Allows |
|---|---|
admin.setting.view |
Opening the Map Search settings page. |
admin.setting.edit |
Saving it. |
CLI
| Command | Schedule | Purpose |
|---|---|---|
mapsearch:resync |
Manual | Recomputes the public location of every pinned listing with the current privacy options, and clears the listings cache. The settings page does it for you when a privacy option changes; run it by hand after changing config/mapsearch.php or restoring a database backup. |
The add-on has no scheduled task and puts nothing on the queue.
Translations
The map page, the location block, the listing map and the settings page are translated into 18 languages: Arabic, Bengali, Chinese, English, French, Georgian, German, Hebrew, Hindi, Italian, Japanese, Portuguese, Romanian, Russian, Spanish, Thai, Turkish and Ukrainian. The files are in extensions/addons/mapsearch/resources/lang/<locale>/messages.php.
In any other language of your site the add-on shows its English texts. To add one, copy the en folder to a folder named after the language code (for example nl) and translate the values of messages.php, keeping the :count, :meters and :app placeholders as they are.
Updating
An update only replaces the add-on's files. Its database tables and data, its settings, its activation state and its recorded purchase code are all kept, so do not deactivate or remove the add-on before updating it. Back up your database first all the same.
Method 1: Upload the new version (recommended)
- Download the latest
.zipfile of the add-on. - Go to Admin panel → Extensions → Add-ons and click Upload add-on.
- Drop the
.zipfile into the upload area. - Because Map Search is already installed, a prompt shows the installed version and the new one. Click Replace: the
extensions/addons/mapsearch/folder is swapped for the new files. Cancelling the prompt discards the upload.
Method 2: Replace the files by hand
- Over FTP or SSH, delete the
extensions/addons/mapsearch/folder and upload the new one in its place. Replace the whole folder rather than copying over it, so files dropped by the new version do not linger. - Open Admin panel → Extensions → Add-ons: the page re-reads
addon.jsonand the card shows the new version number.
After the files are replaced
New database tables or columns. When a new version adds some, create them by running php artisan migrate --force over SSH, or without SSH by clicking Deactivate then Activate on the add-on's card: activation runs every pending migration (and asks for the purchase code again). Your data is not touched either way.
If your installation caches its configuration or routes (php artisan config:cache, route:cache), run php artisan optimize:clear after the update.
Uninstallation
Switching an add-on off without losing anything is a deactivation: go to Admin panel → Extensions → Add-ons, click Deactivate on the Map Search card and confirm.
- The add-on is no longer loaded: its routes, views, admin sidebar entry and front-end pages stop answering.
- Its database tables and all the data they hold are kept, and its files stay under
extensions/addons/mapsearch/. Nothing is deleted. - Its permissions and its recorded purchase code stay in the database. Only Remove deletes them.
- Deactivation is refused while another active add-on depends on this one: deactivate that add-on first.
Click Activate on the same card to switch it back on. As for a first activation, the purchase code is asked for and verified again; then any pending migrations run, the assets are republished, and the add-on picks up exactly where it left off.
Removing
Removing is permanent and destroys the add-on's data. The Remove button only appears on a deactivated add-on, so removal is always two steps:
- Deactivate Map Search (see Uninstallation).
- Click Remove on its card and confirm the prompt.
The admin panel then, in one pass:
- runs the add-on's uninstall hook, if it ships one, while its code is still on disk;
- revokes the permissions declared in its
addon.json; - rolls back its migrations (this drops its database tables and every row they hold) and purges its entries from the
migrationstable, so a later reinstall migrates from scratch; - deletes its published assets:
public/addons/mapsearch/,public/vendor/mapsearch/andstorage/app/public/addons/mapsearch/; - deletes the add-on directory
extensions/addons/mapsearch/; - deletes its row in the
addonstable (the recorded purchase code goes with it) and clears the application cache.
Removal is refused, with an explanatory message and before anything is destroyed, when the add-on is still active, when another active add-on depends on it, or when the web server (PHP) user cannot delete extensions/addons/mapsearch/. In that last case, give that user write permission on the directory and on its parent, then try again.
Deleting the folder over FTP or SSH is not equivalent: the add-on is only switched off, and its tables, its entries in the migrations table and its addons row are all left behind. Use Remove in the admin panel instead.
Troubleshooting
The map page shows "Page not found"
- Check that the add-on is active and that Enable Map Search is on.
- If your routes are cached, run
php artisan optimize:clear.
The Map button, the location block or the listing map is missing
- Your theme does not contain the add-on's lines: see Custom Themes. The themes shipped with the application have them from v19.1.17.
- For the location block, check that Location in the posting form is on; for the listing map, Map on the listing page.
The map area stays grey or empty
- With OpenStreetMap, open the Tile server URL in your browser after replacing
{z}/{x}/{y}with1/1/1: an image must show. If not, the tile provider refuses your site or the URL is wrong. - With Google Maps, open the browser console: Google writes there why a key is refused (API not enabled, referrer not allowed, billing missing).
- A dark map marked "For development purposes only" with the message "This page can't load Google Maps correctly" usually means that billing is not enabled on the Google Cloud project of the key. Address searches are then refused too, and Google may stop the map on that page.
- If the files under
public/vendor/mapsearch/are missing, click Deactivate then Activate on the add-on's card to publish them again.
"Near me" says the position cannot be used
- The site must be served over HTTPS.
- The visitor refused the permission: they can allow it again from the padlock icon of the address bar.
- On a computer without GPS the position comes from the network and can be off by several kilometers. A larger radius helps.
An address is not found in the posting form
- The seller can always place the pin by clicking on the map: the address search is only a shortcut.
- With OpenStreetMap, your server must be allowed to call the address search service over HTTPS. A message about too many searches means the visitor passed 20 searches in a minute.
- With Google Maps, the Geocoding API must be enabled on the key.
Many listings are stacked on the same point
They have no pin and share the position of their city. This is expected for the listings posted before the activation: their sellers add a pin by editing them.
A seller's pin was not saved
- The pin was more than 150 km from the city selected in the form. See Advanced Options to change the limit.
- The seller changed the city after placing the pin, which removes it.
A listing shows its old title or price on the map
Cards are cached for 10 minutes. See card_cache_ttl in Advanced Options.
The marker of a listing is not where the seller placed the pin
With the Approximate area level, this is the purpose: the marker is a shifted point and the listing page shows a circle. See Location Privacy.
The map is slow with many listings
- Keep Group nearby markers on and lower Most markers per search.
- Use a persistent cache driver (Redis, Memcached) so the cards stay cached between searches.
Map Search v1.0.0 · LaraClassifier / JobClass Add-on · by BeDigit