How to show/hide markers from XML file without refreshing the page

我与影子孤独终老i 提交于 2019-12-12 03:56:59

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/12802617/how-to-show-hide-markers-from-xml-file-without-refreshing-the-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!