WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code Required / How to: Increase the circle on map when the property location is hidden

How to: Increase the circle on map when the property location is hidden

1208 views 9

Hide Exact Property Location on the Map

WPResidence includes an option to hide the exact property location on the single property page map.

When this option is enabled, the property page map shows a circle area instead of the exact property pin. This is useful when you want to show the approximate location without displaying the exact address or map point.

Content

  • Enable Hide Map Location
  • How It Shows on the Property Page
  • Change the Circle Size
  • Google Maps Circle Size
  • OpenStreetMap Circle Size
  • Important Notes

Enable Hide Map Location

Go to:

Theme Options > Property Page > Map

Find the option:

Hide map location?

Set it to Yes if you want to hide the exact property pin location.

How It Shows on the Property Page

When Hide map location? is enabled, the property page map will show a circle instead of the exact pin.

The circle marks the approximate location area.

Hidden property location shown as circle on map

Change the Circle Size

There is no Theme Options setting for changing the size of this circle.

The circle size is controlled from the theme JavaScript files. This is a code customization.

Important: Editing parent theme files is not recommended because changes can be lost after a theme update. Use this only if you are comfortable with code changes and keep a backup of the modified file.

The file used for both Google Maps and OpenStreetMap is:

wp-content/themes/wpresidence/js/google_js/mapfunctions.js

The exact line number can change depending on the theme version. Search for the function or code shown below instead of relying only on the line number.

Google Maps Circle Size

For Google Maps, open:

js/google_js/mapfunctions.js

Search for:

function wpestate_custompin(image){

Inside this function, look for this code:

if( !mapfunctions_vars.hidden_map ){
    image ={
        path: google.maps.SymbolPath.CIRCLE,
        scale: 160,
        fillColor: "#0073e1",
        fillOpacity: 0.4,
        strokeWeight: 0.2
    }
    return image;
}

Change the value for:

scale: 160

Use a smaller number for a smaller circle.

Use a larger number for a larger circle.

Example:

scale: 100

OpenStreetMap Circle Size

For OpenStreetMap, open:

js/google_js/mapfunctions.js

Search for:

wpestate_createMarker_sh_leaflet

Inside this function, look for this code:

if( !mapfunctions_vars.hidden_map ){
    propertyMarker = L.circle(markerCenter, {
        color: '#0073e1',
        fillColor: '#0073e1',
        fillOpacity: 0.4,
        strokeWeight: 0.2,
        radius: 120
    });
}

Change the value for:

radius: 120

Use a smaller number for a smaller circle.

Use a larger number for a larger circle.

Example:

radius: 80

Important Notes

  • The option is managed from Theme Options > Property Page > Map > Hide map location?.
  • When enabled, the exact property pin is replaced with an approximate location circle.
  • The circle size cannot be changed from Theme Options.
  • Changing the circle size requires editing theme JavaScript code.
  • The code location may change between theme versions. Search by function name if the line number is different.
  • Parent theme file changes can be overwritten by theme updates.
  • After changing the file, clear theme cache, plugin cache, server/CDN cache, and browser cache.
  • If JavaScript optimization or minification is active, clear or rebuild those files too.
Technical how to | Custom Code Required

Related Articles

  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
  • Introduction to WPResidence Header Customization

Help Categories

  • 18Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 39Elementor Shortcodes Built-In
  • 54FAQ
  • 15Footer
  • 5Getting Started
  • 37Header
  • 2IDX & MLSImport
  • 6Installation & Setup
  • 24Installation FAQ
  • 23Maps & Location Settings
  • 21Multi-Language - Third Party Plugins
  • 6Other Third party Plugins
  • 21Pages
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 37Property Pages & Layouts
  • 32Search & Filtering
  • 162Technical how to | Custom Code Required
  • 8Technical: Actions and filters
  • 7Technical: Child Theme
  • 86Theme Options & Global Settings
  • 7Translations & Languages
  • 16WPBakery Shortcodes
  • 50WPEstate / WPResidence Translate Plugin
  • 51WPResidence / WPEstate CRM
  • 50WPResidence 5.0 Documentation
  • 9WPResidence Elementor Studio

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API