Witam,

posiadam gotowe rozwiązanie, które zainstalowałam na joomli 2.5.
Jednak posiada wiele błędów w plikach PHP i nie działa prawidłowo.
Jestem początkująca dlatego potrzebuje pomocy (w API Google Map).

Problem w tym, że mapa zaciąga złą ilość punktów.


Załączam plik PHP. wIERSZ 77 na pewno m.in. wpływa na ilość markerów na mapie.
Niestety więcej nie potrafie wymyśleć/poprawićsad.gif

  1. <?php
  2. defined('_JEXEC') or die('Restricted access');
  3.  
  4. JHTML::_('behavior.calendar');
  5.  
  6. jimport( 'joomla.utilities.date' );
  7.  
  8. $doc =& JFactory::getDocument();
  9.  
  10.  
  11. $uri =& JFactory::getURI();
  12.  
  13. $url= $uri->root();
  14.  
  15. $image_dir=$url."components/com_hbooking/assets/images/";
  16.  
  17.  
  18. ?>
  19. <script src="http://maps.google.com/maps?file=api&v=1&sensor=true&key=<?php echo $google_api->map_api ;?>" type="text/javascript"></script>
  20.  
  21. <script type="text/javascript">
  22. var WINDOW_HTML_MAP='';
  23. var map = null;
  24. var image_path =null;
  25. var infowindow = null;
  26. var geocoder = null;
  27. var k=0;
  28. function initialize(){
  29. if (GBrowserIsCompatible()) {
  30.  
  31. var mapOptions = {
  32. googleBarOptions : {
  33. style : "new"
  34. }
  35. }
  36.  
  37. map = new GMap2(document.getElementById("map_module_canvas"));
  38. map.setCenter(new GLatLng(52.4193, 19.5816), 6);
  39. // map.addOverlay(new GLatLng(37.4419, -122.1419);
  40. map.setUIToDefault();
  41. // map.enableGoogleBar();
  42. geocoder = new GClientGeocoder();
  43. }
  44.  
  45.  
  46. }
  47.  
  48. function showmapAddress(address,detail) {
  49. //WINDOW_HTML_MAP = detail;
  50. //alert(detail);
  51. if (geocoder) {
  52. geocoder.getLatLng(
  53. address,
  54. function(point) {
  55. if (point)
  56. { var marker = new GMarker(point);
  57. map.setCenter(point, 6);
  58. map.addOverlay(marker);
  59. GEvent.addListener(marker, "click", function() {
  60.  
  61. marker.openInfoWindowHtml(detail);
  62. });
  63.  
  64.  
  65. }
  66. }
  67. );
  68. }
  69.  
  70. }
  71. //initialize();
  72.  
  73. window.onload=function(){
  74. initialize();
  75.  
  76. <?php
  77. [b]for($i=6; $i < count ($hotel_list); $i++ )[/b]
  78. {
  79. $location =$hotel_list[$i]->address1;
  80. $add3 = $hotel_list[$i]->city_id;
  81. $country = $hotel_list[$i]->country_name;
  82.  
  83.  
  84. $address = "";
  85. $linkadd = "";
  86. $address = $location;
  87. $linkadd = $location;
  88. if($add1!="")
  89. {
  90. $address .= ', '.$add1;
  91. $linkadd .= ', '.$add1;
  92. }
  93.  
  94. if($add3!="")
  95. {
  96. $address .= ', '.$add3;
  97. $linkadd .= ', '.$add3;
  98. }
  99.  
  100. if($country!="")
  101. {
  102. $address .= ', '.$country;
  103. $linkadd .= ', '.$country;
  104. }
  105.  
  106. //$address .= ','.$zipcode;
  107. //$linkadd .= ','.$zipcode;
  108. $address .= ', '.$country;
  109. $linkadd .= ', '.$country;
  110. $image_dir=$url."components/com_hbooking/assets/images/";
  111.  
  112. $pp1 = '<div style="width: 210px;padding-right:10px"><table><tr><td width="60px">'.$linkadd.'</td></tr></table></div>';
  113. ?>
  114. image_path = "<?php //echo $this->doclist[$i]->iconpath;?>";
  115.  
  116.  
  117. showmapAddress("<?php echo $address?>",'<?php echo $pp1;?>');
  118.  
  119. <?php } ?>
  120. }
  121. window.onunload=function(){
  122. GUnload();
  123. }
  124. </script>
  125.  
  126.  
  127. <div id="map_module_canvas" style="width: <?php echo $google_api->map_width;?>px; height: <?php echo $google_api->map_height;?>px;border:1px solid #888888;"></div>
  128.  
  129. </form>



Nie wiem czy jeszcze potrzebujecie więcej informacji.

strona: www.tripin.pl


Pozdrawiam


Czy jest w stanie ktoś mi pomóc bo straciłam cierpliwość sad.gif