标签: gdirections

使用 Google Maps API v2 超过 25 个点的 loadFromWaypoints

我有个问题。我知道在谷歌地图中,GDirections.loadFromWayPoints有 25 个GLatLng对象的限制。我想要的是制作一条路线,比如 300 点。

我怎样才能做到这一点?我想到的解决方案是使用 25 个位置的数组,然后调用 loadFromWaypoints,创建另一个 25 个位置的数组,然后调用 loadFromWayPoints 等等,但是当我这样做时,我只能看到我的地图中的第一个数组。

有什么建议?

这是我的 ajax 函数,它尝试执行我所描述的操作:

function ajaxFunction(url){
    var ajaxRequest;  // The variable that makes Ajax possible!

    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }
    // Create …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps gdirections

5
推荐指数
1
解决办法
2139
查看次数

标签 统计

gdirections ×1

google-maps ×1

javascript ×1