• <bdo id='0GW5H'></bdo><ul id='0GW5H'></ul>

    1. <legend id='0GW5H'><style id='0GW5H'><dir id='0GW5H'><q id='0GW5H'></q></dir></style></legend>
      <tfoot id='0GW5H'></tfoot>
    2. <i id='0GW5H'><tr id='0GW5H'><dt id='0GW5H'><q id='0GW5H'><span id='0GW5H'><b id='0GW5H'><form id='0GW5H'><ins id='0GW5H'></ins><ul id='0GW5H'></ul><sub id='0GW5H'></sub></form><legend id='0GW5H'></legend><bdo id='0GW5H'><pre id='0GW5H'><center id='0GW5H'></center></pre></bdo></b><th id='0GW5H'></th></span></q></dt></tr></i><div id='0GW5H'><tfoot id='0GW5H'></tfoot><dl id='0GW5H'><fieldset id='0GW5H'></fieldset></dl></div>

      <small id='0GW5H'></small><noframes id='0GW5H'>

        Http 站点未检测到 Chrome 中的位置 - 问题

        时间:2023-09-06
      1. <legend id='kq5FY'><style id='kq5FY'><dir id='kq5FY'><q id='kq5FY'></q></dir></style></legend>
        • <bdo id='kq5FY'></bdo><ul id='kq5FY'></ul>
            <i id='kq5FY'><tr id='kq5FY'><dt id='kq5FY'><q id='kq5FY'><span id='kq5FY'><b id='kq5FY'><form id='kq5FY'><ins id='kq5FY'></ins><ul id='kq5FY'></ul><sub id='kq5FY'></sub></form><legend id='kq5FY'></legend><bdo id='kq5FY'><pre id='kq5FY'><center id='kq5FY'></center></pre></bdo></b><th id='kq5FY'></th></span></q></dt></tr></i><div id='kq5FY'><tfoot id='kq5FY'></tfoot><dl id='kq5FY'><fieldset id='kq5FY'></fieldset></dl></div>

              1. <tfoot id='kq5FY'></tfoot>

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

                    <tbody id='kq5FY'></tbody>

                  本文介绍了Http 站点未检测到 Chrome 中的位置 - 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我们今天确实注意到了根据用户位置自动检测邮政编码的问题.它在其他浏览器(edge、IE、Firefox)中运行良好我们必须将站点配置为 https,然后它就可以正常工作了

                  We did notice today an issue in automatic detection of zip code based on the user s location. it worked well in other browsers(edge, IE, Firefox) We had to configure the sites to https and then it works ok

                  示例:https://www.whatismyzip.com/ 效果很好其中 http://www.mapdevelopers.com/what-is-my-zip-code.php 不起作用.

                  Example : https://www.whatismyzip.com/ works well where as http://www.mapdevelopers.com/what-is-my-zip-code.php does'nt work.

                    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAdGQKI4sEj5TZAjNCds422V_ZHevD45Fo"></script>
                   <%--   <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>--%>
                  
                   <%--     <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
                   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>--%>
                      <script type="text/javascript">
                  
                  
                          function ShowMessages() {
                  
                              debugger;
                              if (navigator.geolocation) {
                                  navigator.geolocation.getCurrentPosition(success);
                              } else {
                                  alert("Geo Location is not supported on your current browser!");
                              }
                              function success(position) {
                                  debugger;
                                  var lat = position.coords.latitude;
                                  var lng = position.coords.longitude;
                                  var latlng = new google.maps.LatLng(lat, lng);
                                  var geocoder = geocoder = new google.maps.Geocoder();
                                  geocoder.geocode({ 'latLng': latlng }, function (results, status) {
                                      if (status == google.maps.GeocoderStatus.OK) {
                                          if (results[1]) {
                  
                                              var searchAddressComponents = results[0].address_components,
                                               searchPostalCode = "";
                                              $.each(searchAddressComponents, function () {
                                                  if (this.types[0] == "postal_code") {
                                                      searchPostalCode = this.short_name;
                                                  }
                                              });
                  
                                              document.getElementById('hidden1').value = searchPostalCode
                                              __doPostBack('', '');
                  
                  
                                          }
                                      }
                                  });
                              }
                  
                          }
                  

                  任何帮助/解决方法将不胜感激.

                  Any help/workaround would be appreciated.

                  除了 Google API,还有其他可行的替代方案吗?

                  推荐答案

                  Chrome 50 中引入的新安全规则不会将位置信息发送到没有 Transfer Encryption 的站点.

                  The new Security rule introduced in Chrome 50 does not send Location Information to Sites without Transfer Encryption.

                  这里是适合 Mapping API 问题的替代方案.

                  Here are the alternatives which are apt for the Mapping API problems.

                  恢复到之前的 Chrome(50) 版本也是一种解决方案,但是在 Web 开发中,这样做是相当困难的.

                  Reverting to Prior versions of the Chrome(50) is also a solution, but in Web development, it is quite difficult to do so.

                  但事实是,目前只有 ChromeMapping API 存在此类问题,其他 浏览器 仍然支持它们(其中让我暂时放心).

                  But the fact is that, currently only Chrome has such issues with Mapping API and other Browsers still supports them(Which gives me a short term peace of mind).

                  但迟早,这可能会被其他浏览器实践,这对于与我不同的现有用户来说可能是一个大问题.由于这是一个长期的过程(在我的情况下),最好开始开发和迁移到 https 站点而不是在 http 中,但是有 利弊处理它们.

                  But sooner or later, this may be practiced by other browsers too, which may be a big problem for the existing users unlike me. Since it is a long term process(in my case), it is better to start developing and migrating to https sites rather than being in http, how ever there are pros and cons in handling them.

                  这篇关于Http 站点未检测到 Chrome 中的位置 - 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 openweather API 中获取地理位置 下一篇:如何在 Nodejs 中查找所有用户的 geoip 位置

                  相关文章

                  最新文章

                  <legend id='14q4x'><style id='14q4x'><dir id='14q4x'><q id='14q4x'></q></dir></style></legend>
                  <tfoot id='14q4x'></tfoot>

                • <i id='14q4x'><tr id='14q4x'><dt id='14q4x'><q id='14q4x'><span id='14q4x'><b id='14q4x'><form id='14q4x'><ins id='14q4x'></ins><ul id='14q4x'></ul><sub id='14q4x'></sub></form><legend id='14q4x'></legend><bdo id='14q4x'><pre id='14q4x'><center id='14q4x'></center></pre></bdo></b><th id='14q4x'></th></span></q></dt></tr></i><div id='14q4x'><tfoot id='14q4x'></tfoot><dl id='14q4x'><fieldset id='14q4x'></fieldset></dl></div>

                  <small id='14q4x'></small><noframes id='14q4x'>

                    <bdo id='14q4x'></bdo><ul id='14q4x'></ul>