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

问题描述

我要将 Leaflet.markercluster 插件添加到现有的传单地图.

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

我收到此错误:

相对于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/

如插件首页:

对于与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不是函数"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:03