首页 > 技术文章 > Arcgis for Javascript 出现“init.js->TypeError: f is not a function”

jiguixin 2014-02-24 14:41 原文

环境

采用离线JS包,版本为v3.8

问题描述

在为map添加了

app.map.on("pan-start", this.showHandBeignPan());

在拖动地图的时候就会出错,但不影响功能。

在FireFox下就出现了这样的错误:

TypeError: f is not a function

...oLowerCase()})},_onCamelCase:function(f){return"on"+f.substr(0,1).toUpperCase()+...

init.js (第 1160 行)

解决办法

因为网上没有人遇到过,最后发现竟然是在注册方法后面跟了个‘()’导致的。

这个事件下的执行方法有参数,而我没有传相应的参数

pan-start

Fires when a user commences panning. Should be used in favor of onPanStart (Added at v3.5)

Parameters:

<Extent> extent
The current extent of the map as the map is panning.

推荐阅读