I threw together some code very quickly so it's likely to be buggy but check out the slightly modified version of the sample I linked to earlier.
http://demos.geojason.info/anatomy.php What I did was add three additional check boxes that have an id with two (or more) layers instead of one. The ids are separated by commas so that we can split them apart and add/remove the layer as needed. This might help you? The code might be a little confusing if you're not familiar with jQuery but it's pretty self explanatory. Let me know if I need to explain further. On Wed, Jul 21, 2010 at 8:28 PM, Kesuke <[email protected]> wrote: > Thanks Jason, that works for some situations. But I have a problem; > > There are some specific situations where toggling a single checkbox > needs to show/hide more than one layer (because there are a few > situations where an individual object like a muscle actually has to be > made from two layers so that a third layer can travel between them to > make it look diagramatically correct). > > Any ideas how I might apply this? > > It would be so great if a show() hide() feature were added. I realise > keeping the API lightweight is a major consideration in V3, but I > suspect at the level this would be implemented, any developer would be > well aware of the need to keep things light and tidy. > > > > On Jul 21, 7:23 pm, Jason Sanford <[email protected]> wrote: > > I had a similar problem and posted about how I dealt with it here: > http://geojason.info/2010/05/overlay-map-management-with-google-maps-... > > > > Basically what I'm doing is inserting a null value for every overlay I > plan > > on adding to the map into the map.overlayMapTypes array and then creating > a > > new imageMapType when a check box is clicked. > > > > <http://geojason.info/2010/05/overlay-map-management-with-google-maps-.. > .>Probably > > not the most elegant solution, but it seems to work. > > > > > > > > On Wed, Jul 21, 2010 at 8:47 AM, Kesuke <[email protected]> wrote: > > > Thanks for the suggestions, however I'm having two major problems with > > > this approach; > > > > > 1.) It works the first time its clicked, but I think its trying to > > > insertAt or removeAt where objects have already been removed. I'm > > > wondering if when an element is 'removeAt', everything moves down the > > > MCV array. e.g. index 3 becomes 2. > > > > > 2.) Because this involves multiple transparent layers being stacked > > > ontop of each other, it leads to unusual z-index issues where layers > > > end up in the wrong order. You can see this on the example below when > > > you click Pectoralis major twice (to hide, then again to show). It > > > will appear behind the intercostal layer. > > > > > I've setup a test to show the strange behaviour of this approach at > > >http://anatomy.study-medicine.co.uk/testg3t3.html(you<http://anatomy.study-medicine.co.uk/testg3t3.html%28you>can > > > see the > > > code changes on line 298) > > > > > -- > > > 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]<google-maps-js-api-v3%[email protected]> > <google-maps-js-api-v3%2b[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide > quoted text - > > > > - Show quoted text - > > -- > 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]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- 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.
