Skip to content

Instantly share code, notes, and snippets.

@jueyang
Created May 10, 2012 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jueyang/2655748 to your computer and use it in GitHub Desktop.
Save jueyang/2655748 to your computer and use it in GitHub Desktop.
multiple layer switchers?
<div><a id="now" href="#">now</div>
<div id="nav-1"></div>
<div id="nav-2"></div>
new MB.layers('none', 'map', [
{
name: '',
id: 'jue.map-9izw3s28',
el: 'now',
layer: 1,
center: {
lat: -2,
lon: 17,
zoom: 3,
ease: 1000
}
}
]);
new MB.layers('nav-1', 'map', [
{
name: 'International Tribunals',
id: 'jue.map-9izw3s28',
el: 'tribunals',
layer: 1,
center: {
lat: -2,
lon: 19,
zoom: 3,
ease: 1000
}
}
]);
new MB.layers('nav-2', 'map', [
{
name: 'TFV',
id: 'jue.map-9izw3s28',
el: 'TFV',
layer: 1,
center: {
lat: -2,
lon: 19,
zoom: 3,
ease: 1000
}
}
]);
I am trying to create three switchers in the site.
The problem with this approach is that the same layer id is attributed to both nav-1 and nav-2. Is there a way to resolve this?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment