On May 17, 10:32 am, AndrewG <[email protected]> wrote: > Good day, I am trying to have a > show-hide category toggle marker map. > > is there an easy editor/manager for XML to include those categories?
I assume you mean to generate the XML for the map's locations, with the categories you want? There are lots of ways to generate the XML, including by hand. What you choose depends on your familiarity with XML and perhaps your ability to use a language such as Perl, PHP, etc that can provide the tools for creating and modifying XML files. But mainly the question would be: How often would your location information change? If change isn't frequent, you might best take Mike's XML file as a model, and create your own by hand with the locations you want to map. A text editor would do fine for this, and you'd just have to get familiar with how XML docs are structured. I believe some folks use Google Maps (not the programming API) to generate a KML file of their map with markers as a start. They then modify the file (KML is a type of XML) to include their additional information about each placemark (such as the categories you want). At the other end of the spectrum, if your locations are constantly being updated then you might need a program that emits XML on the fly each time the map is queried. Here, you're getting into an awful lot of web traffic and processing cycles, so I hope you don't need that. The middle ground is to have a program that creates a fresh XML file at the time a location is added/updated, placing the refreshed XML file where your map page can reference it once per map creation. How this is done depends on what means you employ for saving and accessing your location data. PHP can generate XML from MySQL queries, for example. There are examples and discussions of this in the Google Maps API list and in Mike's tutorials. In this approach, you're not really working on the XML file directly, so again a text editor would suffice when you do need to take look at the file for debugging. I avoid permanent storage as XML, because the files are huge for the amount of actual data, and editing them by hand is risky because their structures are so fragile and vulnerable to typos and thinkos. So the upshot of all this is that you might not need an app for directly working on your XML file(s). One thing I hope you notice from Mike's example is that the map page is only downloading the XML file and parsing it once. Subsequent actions to show or hide markers by category are done by calling on the markers in memory and checking their attributes. The parsed XML yields an array variable, markers; each location in the array is processed to create a marker for the map, with attributes added for its categories. Those markers are stored in another array variable, gmarkers. From then on, hiding and showing markers is based on looping through gmarkers for markers that have the desired category attributes. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
