Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Google Maps v3 Zoom, Double Click
styryl
post 28.07.2011, 18:57:08
Post #1





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Napisałem sobie kod:

  1.  
  2. var dymek = new google.maps.InfoWindow(); // zmienna globalna
  3.  
  4. function dodajMarker(image,point,txt)
  5. {
  6. // tworzymy marker
  7. var opcjeMarkera =
  8. {
  9. position: point,
  10. map: map,
  11. icon: image
  12. }
  13.  
  14. var marker = new google.maps.Marker(opcjeMarkera);
  15. marker.txt=txt;
  16.  
  17. google.maps.event.addListener(marker,"click",function()
  18. {
  19. dymek.setContent(marker.txt);
  20. dymek.open(map,marker);
  21. });
  22. return marker;
  23. }
  24.  
  25. var latlng = new google.maps.LatLng(52.025459, 19.204102);
  26. var myOptions = {zoom: 6,
  27. center: latlng,
  28. disableDoubleClickZoom: false,
  29. mapTypeId: google.maps.MapTypeId.ROADMAP
  30. };
  31.  
  32. var map = new google.maps.Map(document.getElementById("map"),myOptions);
  33.  
  34. var image = '/media/img/icons/offer.png';
  35. point = new google.maps.LatLng(50.140277777778,18.531388888889)
  36. marker = dodajMarker(image, point, 'test');
  37.  
  38. google.maps.event.addListener(map, "click", function(event)
  39. {
  40. var myLatLng = event.latLng;
  41. var lat = myLatLng.lat();
  42. var lng = myLatLng.lng();
  43.  
  44. marker.setPosition(event.latLng);
  45.  
  46. document.getElementById("lat").value = lat;
  47. document.getElementById("lng").value = lng;
  48. });


Wszystko gra i buczy jednak nie wiem czemu ale przestało działać powiększenie mapy poprzez podwójne kliknięcie myszką. Da się coś z tym zrobić?

Go to the top of the page
+Quote Post

Posty w temacie
- styryl   Google Maps v3 Zoom   28.07.2011, 18:57:08
- - r4xz   "disableDoubleClickZoom: false," spróbuj...   29.07.2011, 07:06:39


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 17:20