如何在不刷新页面的情况下显示/隐藏XML文件中的标记 [英] How to show/hide markers from XML file without refreshing the page

查看:89
本文介绍了如何在不刷新页面的情况下显示/隐藏XML文件中的标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我介绍了一张地图

只有在复选框被选中的情况下才会加载XML文件中的标记。当您取消选中它时,它们仍会一直显示,直到页面刷新。复选框值更改时,如何显示/隐藏它们? Simple

  onclick =initialize(); 

不起作用,反正效率很低。

我无法避免拥有两个xml文件,并且不能使用一个文件而不使用类别而不是它们。

这是一个显示/隐藏基于其分类的标记的示例(再次从Mike Williams的v2教程中翻译):

http://www.geocodezip.com/v3_MW_example_categories.html



编写代码为每个XML文件添加一个类别。


I have a map described here.

Markers from XML files are loaded only if the checkbox is checked. When you uncheck it, they are still displayed until the page is refreshed. How is it possible to show/hide them when the checkbox value is changed? Simple

onclick="initialize();"

doesn't work and would be very inefficient anyway.

I can't avoid having two xml files and can't use one file with categories instead of them.

解决方案

Here is an example which shows/hides markers based on their categories (again translated from Mike Williams' v2 tutorial):

http://www.geocodezip.com/v3_MW_example_categories.html

Write code to add a category for each of the XML files.

这篇关于如何在不刷新页面的情况下显示/隐藏XML文件中的标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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