[Geomoose-users] GeoMoose Extension
Dan Little
theduckylittle at gmail.com
Mon Mar 16 11:31:19 PDT 2015
I hope this leads you in the right direction. gotMapbook should look
something like this:
gotMapbook: function(mapbook) {
var layers = mapbook.getElementsByTagName('catalog')[0].getElementsByTagName('layer');
for(var i = 0, ii = layers.length; i < ii; i++) {
console.log(layers[i].getAttribute('title'));
}
}
I made this code up, it's totally untested, so I apologize for any
typos. :) However, the first parameter passed to gotMapbook
On Sun, Mar 15, 2015 at 8:13 PM, Reynolds, Michael J. (DOT)
<mike.reynolds at state.mn.us> wrote:
> I need a push...
>
> I'm trying to write a GeoMoose extension using the example CustomTab as a start.
>
> My tab appears but now I want my tab startup function to step through the mapbook catalog.
>
> My startup function is hooked to the GeoMOOOSE onMapbookLoaded event.
>
> My problem is, I can't figure out how to get a list/array of layers or catalog items to step through. I've used my developer tools to pause execution of this function and examined what objects are available but nothing fits.
>
> Is there another GeoMOOSE event to hook for this?
>
> Here's my extension so far.
>
> dojo.declare('FavoritesTab', [GeoMOOSE.Tab], {
> title: '',
> iconClass: 'iconFavorite',
>
> startup: function() {
> GeoMOOSE.register('onMapbookLoaded', this, this.gotMapbook);
> },
>
> gotMapbook: function() {
> var layers = ?????; // where an array of layer sources or mapbook catalog layer sources would suffice
> this.set('content', "Loaded...");
> }
> });
>
> dojo.addOnLoad(function() {
> GeoMOOSE.addTab('favorites_tab', new FavoritesTab());
> });
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users
More information about the Geomoose-users
mailing list