On Jan 26, 2:37 am, Andrew Leach <[email protected]>
wrote:
> On Jan 26, 5:12 am, Mike Williams <[email protected]> wrote:
>
> > Or you could write
> >   <marker ...>
> >     <category>ATV</category>
> >     <category>Motorcycle</category>
> >     <category>4x4</category>
> >   </marker>
> > and obtain the list of categories with
> >   markers[i].getElementsByTagName("category")
> > but that's more complicated, makes your XML file larger and doesn't give
> > any advantages over the  categories="ATV,Motorcycle,4x4"  method.
>
> It may make generation of the XML easier as you don't have to worry
> about what happens to the last comma, and it's a better structure
> because you shouldn't really have more than one piece of information
> within an XML element or attribute.
>
> I wrote this to Paul on 10 December when he contacted me directtly:
>
> It's not generally good practice to combine data within a single XML
> element in this way. It would be better to use
> <marker>
>  <category>ATV</category>
>  <category>MC</category>
> </marker>
> because then you can retrieve all the category elements to loop
> through them and extract the text (say as a variable called
> "categorytext"). Within that loop you can then use something similar
> to the Group post you found:
>  marker.mycategory[categorytext]=true
>
> You would then end up with markers with various elements of their
> mycategory property as either true or undefined:
>  marker.mycategory["ATV"]=true
>  marker.mycategory["MC"]=true
> and can use that property to decide whether or not to display the
> marker.
>
> Andrew

Due to my very limited knowledge of javascript, I guess  the best way
to do this would be to create 6 categories:

category1="ATV"
category2="4x4"
category3="Motorcycle"
category4="ATV-4x4"
category5="ATV-Motorcycle"
category6="4x4-Motorcycle"

And then I could use the Part 25 tutorial (Marker Categories).

Is this correct?

Sorry is I'm repeating myself, but I think I'm getting in over my head
and want to keep this as simple as possible.
And I may not be the only one working on this, so want to keep it as
simple as possible.

The only drawback I see is that the users will have to decide which
one of six categories they want.

Thanks for helping me out with this,

Paul

-- 
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.

Reply via email to