简体   繁体   English

Google地图停止显示点v3

[英]Google maps stop showing points v3

Hi i have trouble to find what case a problem to showing the way point on goggle maps as there were no changes in the code for a wile. 嗨,我很难找到哪种情况下会在护目镜地图上显示航路点时出现问题,因为威尔的代码没有变化。 way point stop showing about last week. 途中点停止显示大约上周。 im not familiar with google api 我不熟悉Google API

 var map = null; var markerArray = []; //create a global array to store markers var myPoints = [ [52.664167, -8.509825,' HQ','favicon.ico'] ,[52.836346, -6.913117,'point 1','http://maps.google.com/mapfiles/ms/icons/red.png ' ],[52.836202, -6.912101,'point2','http://maps.google.com/mapfiles/ms/icons/red.png ' ]]; function initialize() { var myOptions = { zoom:7, center: new google.maps.LatLng(53.112, -7.448), mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, navigationControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map"), myOptions); var mcOptions = { gridSize: 30, maxZoom: 15 }; var mc = new MarkerClusterer(map, [], mcOptions); google.maps.event.addListener(map, 'click', function() { infowindow.close(); }); // Add markers to the map // Set up markers based on the number of elements within the myPoints array for(var i=0; i<myPoints.length; i++){ createMarker(new google.maps.LatLng(myPoints[i][0], myPoints[i][1]), myPoints[i][2], myPoints[i][3]); } mc.addMarkers(markerArray , true); } var infowindow = new google.maps.InfoWindow({ size: new google.maps.Size(150, 50) }); function createMarker(latlng, html, icons) { var contentString = html; var links = icons; var marker = new google.maps.Marker({ position: latlng, map: map, icon: links , zIndex: Math.round(latlng.lat() * -100000) << 5 }); // marker.setAnimation(google.maps.Animation.BOUNCE); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(contentString); infowindow.open(map, marker); }); markerArray.push(marker); //push local var marker into global array } window.onload = initialize; 
 <script src="https://maps.googleapis.com/maps/api/js?v=3" type="text/javascript"></script> <div id="map" style="width: 800px; height: 750px;" ></div> 

Any suggestions? 有什么建议么?

It seems that you are using MarkerClusterer which is a part of google maps utility library, which was moved recently. 看来您使用的是MarkerClusterer ,它是最近移动的google maps实用程序库的一部分。 Somebody probably referenced the library straight from code.google.com/svn/... in your project, where it's not available anymore and that's why it's broken. 可能有人在您的项目中直接从code.google.com/svn / ...引用了该库,现在该库不再可用,这就是为什么它已损坏的原因。 You need to find all libraries which are referenced from https://google-maps-utility-library-v3.googlecode.com/svn and replace then with your own links. 您需要找到https://google-maps-utility-library-v3.googlecode.com/svn引用的所有库,然后替换为您自己的链接。

Check this SO question , user had very similar issues to yours. 检查此SO问题 ,用户与您有非常相似的问题。

Also! 也! check this question and answers on SO !!, there are users who experienced issues with the same library, to get more information. 在SO !! 检查此问题和答案 ,有些用户在同一库中遇到问题,以获得更多信息。 Read all answers, as replacing https://google-maps-utility-library-v3.googlecode.com/svn with https://rawgit.com/googlemaps/ ... is not a correct solution, you should download the library assets into your project and reference them from there or use CDN (but not git!). 阅读所有答案,因为将https://google-maps-utility-library-v3.googlecode.com/svn替换为https://rawgit.com/googlemaps/是不正确的解决方案,所以您应该下载该库资产到您的项目中,然后从那里引用它们或使用CDN(但不使用git!)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM