WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code Required / Technical how to : Add extra information into infobox (the images on the map)

Technical how to : Add extra information into infobox (the images on the map)

3935 views 2

This task is very complex and should be tried only by the persons that are fluent in php and javascript.

In a few words (process is explained in reverse order here)

You add infobox  data (image, text etc) by using properties attached to the actual marker. So the data you want to be inserted into infobox must first be “attached” to the marker.

You attach the data to the marked when you create it

The data you need to be attached to the marked is received via an json object created .

The json object is created in php .

 

 

The detailed explanations 

The json onject that have all the listing details  is generated   via wpestate_listing_pins() that calls wpestate_pin_unit_creation() function from pin_managment.php . If you want to add extra info you need to make sure you user rawurlencode like in this line

$place_markers[] = rawurlencode(get_the_post_thumbnail($the_id,'widget_thumb') );

Note here that this code has a index of 18
$place_markers[] = rawurlencode($pin_price);

Add the new info after this line and note that later in js you will need to use index no 19.

After you get all  the info in $markers array we apply the json_encode function.

 

The pins data is then  attached to googlecode_regular_vars  in css_js_include.php around line 475 (to be used in google_map_code.js file)

'markers'           =>  $json_string,

 

In maps_base.js file we have the function wpresidence_google_setMarkers2 that will place markers on the map
get the new info like this
var pin_price = decodeURIComponent ( beach[17] );

replace 17 with your new index – probably 19.

 
The marker is created in wpestate_createMarker (js/mapfunctions.js line 792). The new info will have to be sent as a new parameter, and then used in the function code as a new marker property. For price maker, add it around line 834 , for classic marker add it around line 860.

 

The infobox (the listing image over the map when you click a pin) is created in javascript when you click on the pin. This is done in mapfunctions.js around line 335 via

google.maps.event.addListener(marker, 'click', function(event) {

 

The actual information that is display inside that infobox (image., title, price etc) is added at line 941 in mapfunctions.js. You will have to send the extra info to the function wpestate_generate_infobox, and edit the html code in there in order to add it.


infoBox.setContent( wpestate_generate_infobox(infobox_class,title,link,info_image,price,cleanprice,infosize,infobaths,inforooms));

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
  • 45FAQ
  • 15Footer
  • 5Getting Started
  • 37Header
  • 2IDX & MLSImport
  • 6Installation & Setup
  • 23Installation FAQ
  • 23Maps & Location Settings
  • 21Multi-Language - Third Party Plugins
  • 6Other Third party Plugins
  • 20Pages
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 37Property Pages & Layouts
  • 31Search & Filtering
  • 162Technical how to | Custom Code Required
  • 8Technical: Actions and filters
  • 6Technical: 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