Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 谷歌地图与clearAll的问题_Javascript_Google Maps_Knockout.js - Fatal编程技术网

Javascript 谷歌地图与clearAll的问题

Javascript 谷歌地图与clearAll的问题,javascript,google-maps,knockout.js,Javascript,Google Maps,Knockout.js,我正在尝试编写一个敲除绑定处理程序(当我说write时,我的实际意思是让别人适应我的目的),以帮助我使用谷歌地图 这是我的小提琴: 我已经达到了可以向地图动态添加新标记的程度,但是由于某些原因,我无法将clearAll函数绑定到地图对象 operations = valueAccessor().operations; operations.clearAll.subscribe(function () { console.log('CLea

我正在尝试编写一个敲除绑定处理程序(当我说write时,我的实际意思是让别人适应我的目的),以帮助我使用谷歌地图

这是我的小提琴:

我已经达到了可以向地图动态添加新标记的程度,但是由于某些原因,我无法将clearAll函数绑定到地图对象

operations = valueAccessor().operations;
            operations.clearAll.subscribe(function () {
                console.log('CLearing All Markers');
            });
如果有人能看一看,让我知道我错在哪里,我将不胜感激


非常感谢

看来我的问题是我自己的代码,应该是:

operations = valueAccessor().operations;
            operations.clearAll = function () {
                debugger;
                var bounds = map.getBounds();

            };