简体   繁体   English

弹出openlayers

[英]Pop up openlayers

I am working on a map with different layers. 我正在处理具有不同图层的地图。 My goal would be to display the information of the layers with a pop up as explained in the tutorial of openlayer. 我的目标是按照openlayer 教程中的说明,通过弹出窗口显示层的信息。 However testing the code I get as output: 但是测试我得到的代码作为输出:

Uncaught TypeError: map.on is not a function 未捕获的TypeError:map.on不是函数

Can anyone help me? 谁能帮我?

map.on is not a function means that you have a map variable and it either does not have an on member, or, if it has, on is not a function . map.on不是函数,意味着您具有map变量,并且它没有on成员,或者,如果有,则on不是function Since the error is not telling you that you cannot use .on of undefined , we have to assume that map is either incorrectly initialized or its initialization was not completed yet when you tried to call its on . 由于误差不告诉你,你不能使用.onundefined ,我们必须假设, map要么不正确初始化或当你试图把它的调用它的初始化尚未完成on This answer cannot give you any further information unless you specify your problem further. 除非您进一步指定问题,否则此答案不能为您提供任何更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM