站外跳转到谷歌地图

来源:互联网 发布:python基础语句 编辑:程序博客网 时间:2024/06/03 20:31

https://developers.google.com/maps/documentation/urls/guide


Launch Google Maps and perform a specific action

To launch Google Maps and optionally perform one of the supported functions, use a URL scheme of one of the following forms, depending on the action requested:

  • Search — launch a Google Map that displays a pin for a specific place, or perform a general search and launch a map to display the results:
    https://www.google.com/maps/search/?api=1&parameters
  • Directions — request directions and launch Google Maps with the results:
    https://www.google.com/maps/dir/?api=1&parameters
  • Display a map — launch Google Maps with no markers or directions:
    https://www.google.com/maps/@?api=1&map_action=map&parameters
  • Display a Street View panorama — launch an interactive panorama image:
    https://www.google.com/maps/@?api=1&map_action=pano&parameters


            $.getJSON('https://geoip-db.com/json/', function(response) {                var city = response.city;                var state = response.state;                var country = response.country_name;                console.log('https://geoip-db.com/json/city='+city);//                ShowMarkersByAddr(response.city, '');                if (NeverFound == 1) {                    dialog_alert("提示", "您当前位置未发现洗车设备,请重新搜索");                    //执行一次默认搜索//                    OnAddrSelected();                } else {                    var name = response.city;//                    if (name.indexOf("市") > 0)//                        response.city = name.substr(0, name.indexOf("市"));                    if(response.city != null ){                        $("#city").append("<option value='" + response.city + "'>" + response.city + "</option>");                        $("#city").find("option[value='" + response.city + "']").attr("selected", "selected");                    }                }            });