0

IE7 및 IE8의 첫 번째로드에서 발생하는 Google 사이트의 Google지도 문제를 해결하기 위해 노력하고 있습니다. 내가 파이어 폭스와 ie8 디버거를 결합하여 솔루션을 다루려고했지만 JS가 축소되어 IE 디버거 캔트가 그 일을 처리하기 때문에 내 상사가 다른 문제에 대해서도 밀고있다. 우리는 같은 사이트에서 irelandhotels.com과 groupbke.young.netaffinity.net의 dev 환경의 두 가지 버전을 가지고 있습니다. 처음에는 500 개 이상의 마커가 있고, dev 환경은 5 개 정도입니다. 그러나 문제는 두 사이트 모두에서 발생합니다.Google지도 API (IE7 IE8)로 스택 오버플로

실행은 함수 yf로 이동 한 다음 세 개의 명명되지 않은 함수가있는 루프로 들어갑니다. 이 http://groupbke.young.netaffinity.net/bookings/googlemap

내가 어떤 이미지를 가지고, 단지 지금까지 그들을 게시 할 수 없으며, 그들에 대한 링크 : http://cappuccino.org/discuss/2010/03/01/internet-explorer-global-variables-and-stack-overflows/

우리의지도를 초기화 코드가 여기에 있습니다 :

나는이 문제에 대해 여기에 흥미로운 기사를 발견 :/

모든 도움을 주시면 대단히 감사하겠습니다.

게르 겔리

난 항상 과거에 이런 짓을 한 방법

답변

0

은 다음과 같이이다 : 또한

function initialize(mapid) { 
    // make this local to your initialize function 
    var hoteldata = [ 
     ['Griffen Hotel S1', 53.27093787103, -6.30448181406804, 'Lorem Ipsum', 1], 
     ['Young Testing Hotel - Liège', 53.33932, -6.261427, 'Lorem Ipsum', 4] 
    ]; 

    var myOptions = { 
     zoom: 15, // according to the documentation zoom and center are required when creating instances of the Map class 
     center: new google.maps.LatLng(50.820645,-0.137376), 
     mapTypeId: google.maps.MapTypeId.ROADMAP, 
     mapTypeControl: false 
    }; 
    var bounds = new google.maps.LatLngBounds(); 
    var map = new google.maps.Map(document.getElementById(mapid), myOptions); 
    var infowindow = new google.maps.InfoWindow(); 
    var markers = []; 
    var i, latLng, img; 

    for (i = 0; i < hoteldata.length; i++) { 
     latLng = new google.maps.LatLng(hoteldata[i][1], hoteldata[i][2]); 
     bounds.extend(latLng); 

     // why not use a switch here? 
     img = '/images/hotel-marker.png'; 
     if (hoteldata[i][4] == 2) { 
      img = '/images/country-marker.png'; 
     } 
     if (hoteldata[i][4] == 3) { 
      img = '/images/guesthouse-marker.png'; 
     } 
     if (hoteldata[i][4] == 4) { 
      img = '/images/hotel-self-marker.png'; 
     } 
     var marker = new google.maps.Marker({ 
     position: latLng, 
     icon: img, 
     shadow: '/images/marker-shadow.png' 
     }); 
     markers.push(marker); 

     bindInfoWindow(marker, map, infowindow, hoteldata[i][3]); 
    } 

    map.fitBounds(bounds); 
} 

function bindInfoWindow(marker, map, infowindow, html) { 
    google.maps.event.addListener(marker, 'click', function() { 
     infowindow.setContent(html); 
     infowindow.open(map, marker); 
    }); 
} 

, (이 문제 아니라고하지만) IE 배열 또는 최종 구조를 싫어 후행 쉼표로

var hoteldata = [ 
    ['Griffen Hotel S1', 53.27093787103, -6.30448181406804, '<div class="nearby-hotel"> <h1><a href="/hotels/ireland/dublin/dublin/griffen-hotel-s1">Griffen Hotel S1</a></h1> <div class="star-rating-0"></div><div class="clear"></div> <div class="nearby-hotel-image l"> <a href="/hotels/ireland/dublin/dublin/griffen-hotel-s1"><img src="http://groupbke.young.netaffinity.net/images/placeholder-60px.jpg" border="1" class="imagetype1"/></a> </a> </div> <div class="nearby-hotel-description l"> <a class="nearby-hotel-desc" href="/hotels/ireland/dublin/dublin/griffen-hotel-s1">Located in the heart of the city, this charming 100 executive Bedroom hotel is just a minute\'s walk from the main shopping and business districts.  Just step into the reception area and immediately you will know that you are somewhere very special. The beautiful reception area invites you to relax with the daily paper or a soothing drink whilst you contemplate your day. With sumptuous executive hotel rooms and something for all the family, the Griffen Hotel undoubtedly earns its reputation as one of the cities finest. </a> <a href="/hotels/ireland/dublin/dublin/griffen-hotel-s1" class="btn-small">Book Now</a> </div> <div class="clear"></div> </div>', ], 
    ... 
]; 

은 첫 번째 닫기 전에 마지막 제거] 그래서 다음과 같습니다 메모에 대한

var hoteldata = [ 
    ['Griffen Hotel S1', 53.27093787103, -6.30448181406804, '<div class="nearby-hotel"> <h1><a href="/hotels/ireland/dublin/dublin/griffen-hotel-s1">Griffen Hotel S1</a></h1> <div class="star-rating-0"></div><div class="clear"></div> <div class="nearby-hotel-image l"> <a href="/hotels/ireland/dublin/dublin/griffen-hotel-s1"><img src="http://groupbke.young.netaffinity.net/images/placeholder-60px.jpg" border="1" class="imagetype1"/></a> </a> </div> <div class="nearby-hotel-description l"> <a class="nearby-hotel-desc" href="/hotels/ireland/dublin/dublin/griffen-hotel-s1">Located in the heart of the city, this charming 100 executive Bedroom hotel is just a minute\'s walk from the main shopping and business districts.  Just step into the reception area and immediately you will know that you are somewhere very special. The beautiful reception area invites you to relax with the daily paper or a soothing drink whilst you contemplate your day. With sumptuous executive hotel rooms and something for all the family, the Griffen Hotel undoubtedly earns its reputation as one of the cities finest. </a> <a href="/hotels/ireland/dublin/dublin/griffen-hotel-s1" class="btn-small">Book Now</a> </div> <div class="clear"></div> </div>'], 
    ... 
]; 
+0

덕분에, 나는이 문제를 해결했지만,이 문제를 일으키는 게 아니에요. –

+0

확인, 업데이트 내 대답 – duncan

+0

내 말은, 나는 여전히 오류가 발생했습니다. –