Location Metabox (Pro)

PRO FEATURE

The Location Coordinates metabox provides a visual, user-friendly interface for setting location coordinates. Instead of manually looking up lat/lng values, you can search for addresses, drag markers, or use your browser’s geolocation.

Complete metabox interface

Metabox Features Overview

  • Interactive Leaflet map preview
  • Address/postcode geocoding search
  • Autocomplete address suggestions
  • Draggable marker
  • Click-to-place marker
  • “Use My Location” browser geolocation
  • Manual lat/lng coordinate entry
  • Custom pin color picker

Using the Visual Map Interface

Method 1: Address Search (Recommended)

The easiest way to set a location:

  1. Type an address or postcode in the search field
  2. Select from autocomplete suggestions (or press Enter)
  3. Map zooms to the location and places a marker
  4. Drag the marker to fine-tune the exact position
  5. Coordinates auto-update in the fields below
Tip: For best results, use postcodes (UK: SW1A 2AA) or full addresses. Street names alone may be ambiguous.

Method 2: Click on Map

Click anywhere on the map to place the marker:

  1. Zoom in to your desired area using the zoom controls
  2. Pan by dragging the map
  3. Click the exact location where you want the marker
  4. Coordinates update automatically

Method 3: Drag Marker

Fine-tune positioning by dragging:

  1. Click and hold the existing marker
  2. Drag it to the desired position
  3. Release to drop
  4. Coordinates update in real-time

Method 4: Use My Location

Quickly center on your current location:

  1. Click the Use My Location button
  2. Grant location permission in your browser (if prompted)
  3. Map centers on your current GPS coordinates
  4. Marker is placed at your location
Privacy Note: This feature requires browser location permission and only works on HTTPS sites or localhost. Your location is not stored or transmitted anywhere – it’s only used to center the map.

Method 5: Manual Entry

Enter coordinates directly if you already know them:

  1. Type latitude in the Latitude field (e.g., 51.5074)
  2. Type longitude in the Longitude field (e.g., -0.1278)
  3. Marker moves to the entered coordinates
  4. Map pans to show the marker
Format: Latitude must be between -90 and 90. Longitude must be between -180 and 180. Use decimal format (not degrees/minutes/seconds).

Address Geocoding

How Geocoding Works

The plugin uses the free Nominatim API (by OpenStreetMap) to convert addresses to coordinates:

  1. You type an address or postcode
  2. Plugin sends request to Nominatim
  3. Nominatim returns matching locations
  4. Map updates with the result

Autocomplete Suggestions

As you type, suggested addresses appear below the search field:

  • Shows up to 5 matching results
  • Click any suggestion to select it
  • Appears after typing at least 3 characters
  • Debounced to avoid excessive requests (500ms delay)
Address autocomplete suggestions

Supported Search Formats

You can search for:

  • Postcodes: SW1A 2AA, 10001, etc.
  • Full Addresses: 10 Downing Street, London
  • Landmarks: Eiffel Tower, Big Ben
  • Cities: London, New York
  • Streets: Oxford Street, London (less precise)

Rate Limiting

Nominatim has a fair use policy of 1 request per second:

  • Autocomplete is debounced (waits 500ms after you stop typing)
  • Manual searches respect the 1 req/sec limit
  • Results are cached for 24 hours to reduce requests
Note: If you search too quickly, you may see a “Too many requests” message. Wait a moment and try again.

Custom Pin Colors

Each location can have a unique marker color on the frontend map:

Setting Pin Color

  1. In the metabox, find the Pin Color field
  2. Click to open the WordPress color picker
  3. Choose a color or enter a hex code
  4. Marker preview updates with the chosen color
  5. Save the post to apply the color
Default Color: If no color is set, markers display as red (#d63638) on the frontend.

Using Custom Colors

Color-code locations by category:

  • Blue: Main offices
  • Green: Retail stores
  • Orange: Warehouses
  • Red: Service centers

The custom colors automatically apply when using Dynamic Locations mode in the widget.

Pin color picker

Preview Links

Once coordinates are set, a preview link appears at the bottom of the metabox:

  • Preview on OpenStreetMap – Opens location in new tab
  • Useful for verifying the correct location
  • Shows surrounding area and landmarks

Saving Coordinates

Coordinates are saved as WordPress post meta when you save the post:

  • _lmfe_latitude – Hidden field (underscore prefix)
  • _lmfe_longitude – Hidden field
  • lmfe_pin_color – Visible in Custom Fields (no underscore)
Technical Note: The underscore prefix hides fields from WordPress’s default Custom Fields metabox, keeping the UI clean.

Troubleshooting the Metabox

Map Not Loading

If the map doesn’t appear:

  1. Check browser console for JavaScript errors
  2. Ensure Leaflet.js is loading (check network tab)
  3. Disable other plugins that might conflict
  4. Clear browser cache

Search Not Working

If address search isn’t returning results:

  1. Check your internet connection
  2. Try a more specific search (include city/country)
  3. Wait a moment if you’ve searched too quickly (rate limiting)
  4. Check if Nominatim API is accessible from your server

Coordinates Not Saving

If coordinates don’t persist after saving:

  1. Ensure you have permission to edit the post
  2. Check for PHP errors in debug.log
  3. Verify post meta is being saved (use Query Monitor plugin)
  4. Try deactivating conflicting plugins

Need more help?

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Asset-22@2x-8.png

Sales

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Asset-18@2x-8.png

Help & support

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Asset-206@2x-8.png

Article & News

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.