2026年5月

$('#baidu').attr('href','http://api.map.baidu.com/marker?location=' + lat + ',' + lon + '&title=' + name + '&content=' + address + '&output=html')

    $('#baidu').attr('href','baidumap://map/direction?destination=' + lat + ',' + lon + '|' + name + '&mode=driving')
    $('#gaode').attr('href','https://uri.amap.com/marker?position=' + lon + ',' + lat + '&name=' + name + '&src=mypage&callnative=1')
    // const isIOS = /iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());
    // if (isIOS) {
    //     $('#gaode').attr('href','iosamap://navi?sourceApplication=myapp&lat=' + lat + '&lon=' + lon + '&poiname=' + encodeURIComponent(name) + '&dev=0&style=2')
    // } else {
    //     $('#gaode').attr('href','androidamap://navi?sourceApplication=myapp&lat=' + lat + '&lon=' + lon + '&poiname=' + encodeURIComponent(name) + '&dev=0&style=2')
    // }

1、正常使用:json_encode($post_data)
2、加参使用:json_encode($post_data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)

JSON_UNESCAPED_UNICODE:中文不转 \u
JSON_UNESCAPED_SLASHES:路径不加反斜杠
JSON_PRETTY_PRINT:格式化显示,自动分行缩进