传单Markercluster-"this._featureGroup.addEventParent不是函数" [英] Leaflet Markercluster - "this._featureGroup.addEventParent is not a function"

查看:243
本文介绍了传单Markercluster-"this._featureGroup.addEventParent不是函数"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要将 Leaflet.markercluster 插件添加到现有的

I am adding Leaflet.markercluster plugin to my existing Leaflet map.

我收到此错误:

未捕获的TypeError:this._featureGroup.addEventParent不是函数

相对于var locations = L.markerClusterGroup();行.

我找不到有关此错误可能意味着什么的任何信息.

I cannot find any information about what this error might mean.

我链接到Markercluster JS文件,并在Leaflet之后.不知道为什么会找不到功能.

I am linking to the Markercluster JS file, and after Leaflet. Not sure why else it would not be able to find a function.

推荐答案

这是使用Leaflet版本<时出现的错误. 1(例如0.7.7)和Leaflet.markercluster版本1+(例如1.0.0)

That is the error you get when you use Leaflet version < 1 (e.g. 0.7.7) with Leaflet.markercluster version 1+ (e.g. 1.0.0)

演示: https://jsfiddle.net/z6bc79dq/

如插件首页:

需要传单1.0.0

Requires Leaflet 1.0.0

对于与Leaflet 0.7兼容的版本,请使用leaflet-0.7分支

For a Leaflet 0.7 compatible version, use the leaflet-0.7 branch

(Leaflet.markercluster版本 0.5.0 是最新与Leaflet 0.7.x兼容)

(Leaflet.markercluster version 0.5.0 is the latest compatible with Leaflet 0.7.x)

这篇关于传单Markercluster-"this._featureGroup.addEventParent不是函数"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆