On 10 December 2011 20:39, Kishanth Mehra <[email protected]> wrote:
> We can see the Grand Hotel De Rozza has a place to eat (Restaurant). It has
> also a Swimmingpool and you can stay there for few nights. But it hasn't got
> a Pub!
> So when I check the Restaurant category "McDonalds" and "Grand Hotel De
> Rozza" must be visible!
> And when I check the Restaurant and Swimmingpool: "McDonalds" & "Joe
> Swimming and "Grand Hotel De Rozza" must be visible one time!
>
> Does anyone have any idea or JS Sample?

Normally when deciding which marker to display one might use
"switch/case". In this case when you are finding which markers to
show, you need to see whether the category attribute *contains* the
required string, rather than whether it *equals* the required string.
For that, use indexOf: for example, category.indexOf("Swimmingpool")
must be greater than -1 (Not greater than zero, because strings start
counting characters from zero). Of course, this will also find
matching categories where there is only value, eg Joe Swimming.

http://www.w3schools.com/jsref/jsref_indexof.asp

This should be a fairly straightforward extension of an XML example.
Not a maps question though.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to