久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='OuCnB'></bdo><ul id='OuCnB'></ul>
      1. <tfoot id='OuCnB'></tfoot>
      2. <small id='OuCnB'></small><noframes id='OuCnB'>

        <i id='OuCnB'><tr id='OuCnB'><dt id='OuCnB'><q id='OuCnB'><span id='OuCnB'><b id='OuCnB'><form id='OuCnB'><ins id='OuCnB'></ins><ul id='OuCnB'></ul><sub id='OuCnB'></sub></form><legend id='OuCnB'></legend><bdo id='OuCnB'><pre id='OuCnB'><center id='OuCnB'></center></pre></bdo></b><th id='OuCnB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OuCnB'><tfoot id='OuCnB'></tfoot><dl id='OuCnB'><fieldset id='OuCnB'></fieldset></dl></div>

        <legend id='OuCnB'><style id='OuCnB'><dir id='OuCnB'><q id='OuCnB'></q></dir></style></legend>
      3. 向谷歌地圖添加多個標記

        Adding multiple markers to Google Map(向谷歌地圖添加多個標記)

                  <tbody id='VaIKC'></tbody>

                <legend id='VaIKC'><style id='VaIKC'><dir id='VaIKC'><q id='VaIKC'></q></dir></style></legend>
                <tfoot id='VaIKC'></tfoot>

                • <bdo id='VaIKC'></bdo><ul id='VaIKC'></ul>
                • <small id='VaIKC'></small><noframes id='VaIKC'>

                  <i id='VaIKC'><tr id='VaIKC'><dt id='VaIKC'><q id='VaIKC'><span id='VaIKC'><b id='VaIKC'><form id='VaIKC'><ins id='VaIKC'></ins><ul id='VaIKC'></ul><sub id='VaIKC'></sub></form><legend id='VaIKC'></legend><bdo id='VaIKC'><pre id='VaIKC'><center id='VaIKC'></center></pre></bdo></b><th id='VaIKC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VaIKC'><tfoot id='VaIKC'></tfoot><dl id='VaIKC'><fieldset id='VaIKC'></fieldset></dl></div>

                • 本文介紹了向谷歌地圖添加多個標記的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我希望為 Google 地圖 v3 API 中列出的每個企業添加標記在這個頁面上在右上角.

                  I'm looking to add markers for each business listed to a Google map v3 API on this page in the top right hand corner.

                  我不確定如何為多個郵政編碼執行此操作,但我們目前在 個別業務頁面對存儲在數據庫中的動態郵政編碼使用 URLencode.

                  I'm not sure how to do this for multiple postcodes, but the one we currently use on the individual business pages use a URLencode for the dynamic postcodes stored in the database.

                  這是我們用于各個頁面的代碼:

                  Here's the code we use for the individual pages:

                  <script src="http://maps.googleapis.com/maps/api/js?q=London&key=AIzaSyBaPEDyFbbnWjtvT8W3UBOM34Y7g6vK69A&sensor=false"></script>
                  
                      var map;
                      function initialize() {
                        var mapOptions = {
                          zoom: 15,
                          center: new google.maps.LatLng(51.511214,-0.119824),
                          mapTypeId: google.maps.MapTypeId.ROADMAP
                        };
                        var geolocate = function(address, callback) {
                              $.ajax({
                                      url: "http://maps.googleapis.com/maps/api/geocode/json",
                                      data: {
                                          "sensor": true,
                                          "address": address
                                      },
                                      dataType: "json",
                                      success: function(d) {
                                          if (d.status == "ZERO_RESULTS") callback(false);
                                          if (d.results && d.results[0] && d.results[0].geometry) {
                                              callback({
                                                  "ne": d.results[0].geometry.bounds.northeast,
                                                  "sw": d.results[0].geometry.bounds.southwest,
                                                  "center": d.results[0].geometry.location
                                              });
                                          }
                                          else callback(false);
                                      }
                                  });
                        };
                        map = new google.maps.Map(document.getElementById('map-canvas'),
                            mapOptions);
                        geolocate("<%=server.URLEncode(""&rsAdvert("ContactPostcode"))%>", function(c) {
                              map.setCenter(new google.maps.LatLng(c.center.lat, c.center.lng));
                       });
                      }
                      google.maps.event.addDomListener(window, 'load', initialize);
                  
                  $('#myModal').on('shown', function () {
                    google.maps.event.trigger(map, 'resize');
                  })
                  

                  該頁面的郵政編碼是在 ASP 中生成的:

                  The postcodes for that page are generated in ASP:

                      if rsDB_Ads("ContactPostcode") <> "" then
                          strTempHTML = "[ContactPostcode]"
                          strDB_AdvertItem = Replace(strDB_AdvertItem, "<!--ContactPostcode-->", strTempHTML)
                      Else
                          strDB_AdvertItem = Replace(strDB_AdvertItem, "<!--ContactPostcode-->", "")
                      End if
                  

                  希望有人可以提供幫助..

                  Hoping someone can help..

                  推薦答案

                  只是開始,這里是如何管理多個標記.(將代碼復制并粘貼到 html 文件中,它就可以工作了......)然后您可以通過經典的 asp 從數據庫等中寫出位置來調整代碼:

                  Just for a start, here is how to manage multiple markers. (copy & Paste the code into a html file and it works ...) You can then adapt the code by writing out the locations from a db etc. via classic asp:

                      <!DOCTYPE html>
                      <html>
                      <head>
                        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
                        <title>Google Maps Multiple Markers</title>
                        <script src="http://maps.google.com/maps/api/js?sensor=false"
                                type="text/javascript"></script>
                      </head>
                      <body>
                        <div id="map" style="width: 1000px; height: 1000px;"></div>
                  
                        <script type="text/javascript">
                          var locations = [
                            ['Stadtbibliothek Zanklhof', 47.06976, 15.43154, 1],
                            ['Stadtbibliothek dieMediathek', 47.06975, 15.43116, 2],
                            ['Stadtbibliothek G?sting', 47.09399, 15.40548, 3],
                            ['Stadtbibliothek Graz West', 47.06993, 15.40727, 4],
                            ['Stadtbibliothek Graz Ost', 47.06934, 15.45888, 5],
                            ['Stadtbibliothek Graz Süd', 47.04572, 15.43234, 6],
                            ['Stadtbibliothek Graz Nord', 47.08350, 15.43212, 7],
                            ['Stadtbibliothek Andritz', 47.10280, 15.42137, 8]
                          ];
                  
                          var map = new google.maps.Map(document.getElementById('map'), {
                            zoom: 13,
                            center: new google.maps.LatLng(47.071876, 15.441456),
                            mapTypeId: google.maps.MapTypeId.ROADMAP
                          });
                  
                          var infowindow = new google.maps.InfoWindow();
                  
                          var marker, i;
                  
                          for (i = 0; i < locations.length; i++) {
                            marker = new google.maps.Marker({
                              position: new google.maps.LatLng(locations[i][1], locations[i][2]),
                              map: map
                            });
                  
                            google.maps.event.addListener(marker, 'click', (function(marker, i) {
                              return function() {
                                infowindow.setContent(locations[i][0]);
                                infowindow.open(map, marker);
                              }
                            })(marker, i));
                          }
                        </script>
                      </body>
                      </html>
                  

                  這篇關于向谷歌地圖添加多個標記的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                  <tfoot id='rGAFp'></tfoot>

                  <small id='rGAFp'></small><noframes id='rGAFp'>

                    • <legend id='rGAFp'><style id='rGAFp'><dir id='rGAFp'><q id='rGAFp'></q></dir></style></legend>
                    • <i id='rGAFp'><tr id='rGAFp'><dt id='rGAFp'><q id='rGAFp'><span id='rGAFp'><b id='rGAFp'><form id='rGAFp'><ins id='rGAFp'></ins><ul id='rGAFp'></ul><sub id='rGAFp'></sub></form><legend id='rGAFp'></legend><bdo id='rGAFp'><pre id='rGAFp'><center id='rGAFp'></center></pre></bdo></b><th id='rGAFp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rGAFp'><tfoot id='rGAFp'></tfoot><dl id='rGAFp'><fieldset id='rGAFp'></fieldset></dl></div>
                        <tbody id='rGAFp'></tbody>
                        <bdo id='rGAFp'></bdo><ul id='rGAFp'></ul>

                            主站蜘蛛池模板: 精品久久久一区 | 午夜小视频在线播放 | 国产免费一区 | 国产资源在线视频 | 亚洲精品日韩视频 | 亚洲iv一区二区三区 | 亚洲成人三级 | 最新中文字幕在线播放 | 亚洲一区二区在线视频 | 国产精品一二三区 | 日韩在线小视频 | 99综合| 精品中文字幕在线观看 | 日韩高清一区二区 | 亚洲精品久久视频 | 国产精品国产a级 | 成人视屏在线观看 | 91精品国产91久久综合桃花 | 亚洲成av | 久久一区二区视频 | 久草热线 | 久久久久久久久综合 | 国产高清在线 | 一区二区三区网站 | 剑来高清在线观看 | 亚洲国产精品一区 | 国产黄色精品在线观看 | 夜夜骑首页 | 欧美二区三区 | 国产精品99久久久久久大便 | 国产成人综合在线 | 日日夜夜精品视频 | 中国三级黄色录像 | 日韩中文字幕一区 | 精品久久一区 | 国产1区2区在线观看 | 99爱在线| 国产精品网址 | 日韩av在线免费 | 91爱爱·com | 午夜精品久久久久久久久久久久久 |