Changeset 466
- Timestamp:
- 11/25/08 15:26:26 (1 month ago)
- Files:
-
- trunk/apps/intranet/modules/maps/templates/showSuccess.php (modified) (2 diffs)
- trunk/lib/phoogle.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/intranet/modules/maps/templates/showSuccess.php
r465 r466 1 1 <h3><?php echo ucfirst(__('map')) ?></h3> 2 2 <?php include_partial('sales/thumb', array('sales' => $sales)) ?> 3 <div id="pano_main" style="display: none;width: 679px; height: 470px;"> 4 <h3>Google street view</h3> 5 <div name="pano" id="pano" style="width: 679px; height: 400px;"></div> 6 <hr /> 7 </div> 3 8 <?php 4 9 $map = new PhoogleMap(); 5 10 $map->setWidth(679); 6 11 $map->setHeight(400); 7 $map->zoomLevel = 3;12 $map->zoomLevel = 2; 8 13 $map->setAPIKey(GOOGLE_MAP_KEY); 9 14 slot('gmapheader'); … … 15 20 $address .= $sales->getEstate()->getPostalcode().' '; 16 21 $address .= $sales->getEstate()->getCityValue().', FRANCE'; 17 $map->addAddress($address, '<strong>'.ucfirst(__('sale')).'</strong><br />'.addslashes(ereg_replace(',', '<br />', $address))); 18 19 $address = $sales->getContactRelatedBySellerId()->getAddress1().', '; 20 if($sales->getContactRelatedBySellerId()->getAddress2()) 21 $address .= $sales->getContactRelatedBySellerId()->getAddress2().', '; 22 $address .= $sales->getContactRelatedBySellerId()->getPostalcode().' '; 23 $address .= $sales->getContactRelatedBySellerId()->getCityValue().', '.$sales->getContactRelatedBySellerId()->getCountry(); 24 $map->addAddress($address, '<strong>'.ucfirst(__('seller')).'</strong><br />'.$sales->getContactRelatedBySellerId().'<br />'.addslashes(ereg_replace(',', '<br />', $address))); 25 $map->showMap(); 22 $points = $map->getPoints($address); 23 $map->addGeoPoint($points['lat'], $points['lon'], '<strong>'.ucfirst(__('sale')).'</strong><br />'.addslashes(ereg_replace(',', '<br />', $address))); 24 $map->showMap(true); 26 25 ?> trunk/lib/phoogle.php
r3 r466 268 268 * @description Displays the Google Map on the page 269 269 */ 270 function showMap( ){270 function showMap($streetview = false){ 271 271 echo "\n<div id=\"map\" style=\"width: ".$this->mapWidth."px; height: ".$this->mapHeight."px\">\n</div>\n"; 272 272 echo " <script type=\"text/javascript\">\n … … 312 312 echo "});\n"; 313 313 } 314 315 if($streetview): 316 echo" 317 var myPano = new GStreetviewPanorama(document.getElementById('pano')); 318 svOverlay = new GStreetviewOverlay(); 319 map.addOverlay(svOverlay); 320 GEvent.addListener(map,'click', function(overlay,latlng) { 321 myPano.setLocationAndPOV(latlng); 322 Element.show('pano_main'); 323 }); 324 "; 325 endif; 326 314 327 echo " //]]>\n 315 328 } … … 337 350 } 338 351 function characterData($parser,$data){ 339 $key=end($this->keys); 340 $this->arrays[$this->depth][$key]=$data; 341 $this->node_flag=0; 342 } 352 if(!trim($data)) return; 353 $key=end($this->keys); 354 $this->arrays[$this->depth][$key]=$data; 355 $this->node_flag=0; 356 } 343 357 function endElement($parser, $name) 344 358 {
