function vp_map_pins($tproperties) { global $vp_searchvars; $pstr = "var locations = ["; $first = true; $lng = 0; $lat = 0; $linktext = ""; foreach ($tproperties as $property) { if ($lng != $property->longitude || $lat != $property->latitude) { if ($linktext != "") { $pstr .= "'" . $linktext . "'"; $pstr .= "]\r\n"; } if ($first) { $first = false; } else { $pstr .= ","; } $pstr .= "["; $pstr .= "'" . $property->address_custom . "',"; $pstr .= "'" . $property->latitude . "',"; $pstr .= "'" . $property->longitude . "',"; $linktext = ""; $lng = $property->longitude; $lat = $property->latitude; } $linktext .= str_replace("'", "\\'", "<div class=\"vp_marker_content clearfix\"><a href=\"" . vp_propertyurl($property->vebraid) . "\">" . vp_propertyimage($property->vebraid, 0, "vp_pin_image") . "<br /><div class='vp_pin_details'><em>" . $property->address_display . "</em><br />" . $property->property_type . "</em><span>£" . number_format($property->price, 0, "", ",") . " " . $property->price_postfix . "</span></div><div class='vp_pin_link'>View details</div></a></div>"); } if ($linktext != "") { $pstr .= "'" . $linktext . "'"; $pstr .= "]\r\n"; } $pstr .= "];\r\n"; if (array_key_exists("lat", $vp_searchvars) && array_key_exists("lng", $vp_searchvars)) { $pstr .= "var myLatLng = new google.maps.LatLng(" . $vp_searchvars["lat"] . "," . $vp_searchvars["lng"] . ");\r\n"; } else { $options = get_option("vp_options"); $pstr .= "var myLatLng = new google.maps.LatLng(" . $options["lat"] . "," . $options["lng"] . ");\r\n"; } $pstr .= "var myRadius = 1609.344 * " . $vp_searchvars["radius"] . "\r\n"; if ($vp_searchvars["radius"] < 3) { $pstr .= "var myZoom=13;\r\n"; } if ($vp_searchvars["radius"] >= 3 && $vp_searchvars["radius"] < 5) { $pstr .= "var myZoom=12;\r\n"; } if ($vp_searchvars["radius"] >= 5 && $vp_searchvars["radius"] < 10) { $pstr .= "var myZoom=11;\r\n"; } if ($vp_searchvars["radius"] >= 10 && $vp_searchvars["radius"] < 20) { $pstr .= "var myZoom=10;\r\n"; } if ($vp_searchvars["radius"] >= 20 && $vp_searchvars["radius"] < 40) { $pstr .= "var myZoom=9;\r\n"; } if ($vp_searchvars["radius"] >= 40) { $pstr .= "var myZoom=8;\r\n"; } if ($vp_searchvars["location"] == "") { $pstr .= "var showRadius=false;\r\n"; } else { $pstr .= "var showRadius=true;\r\n"; } return $pstr; }
<div class="property"> <div class="left_column"> <div class="property_tagline badge_<?php echo str_replace(" ", "_", $property->web_status); ?> "></div> <div class="property_image"> <a class="property_overview_thumb" href="<?php echo vp_propertyurl($property->vebraid); ?> " title="<?php echo $property->address_name; ?> "> <?php echo vp_propertyimage($property->vebraid, 0, "property_image"); ?> </a> </div> </div> <div class="right_column"> <ul class="property_summary"> <li class="property_title"> <a href="<?php echo vp_propertyurl($property->vebraid); ?> "><?php echo $property->address_custom; ?> <span><?php echo $property->property_type;
<script type="text/javascript"> function ginitialize() { var myLatlng = new google.maps.LatLng(<?php echo $property->latitude; ?> , <?php echo $property->longitude; ?> ); var mapOptions = { zoom: 12, center: myLatlng } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var contentString = '<div class="vp_marker_content"><?php echo vp_propertyimage($property->vebraid, 0, "vp_pin_image"); ?> <br /><em><?php echo $property->address_custom; ?> </em><br /><?php echo $property->property_type; ?> </em><br /><span>£<?php echo number_format($property->price, 0, "", ","); ?> <?php echo $property->price_postfix; ?> </span><br /><a href="<?php echo vp_propertyurl($property->vebraid);