Skip to content

Instantly share code, notes, and snippets.

@eightysteele
Created March 28, 2011 14:32
Show Gist options
  • Select an option

  • Save eightysteele/890567 to your computer and use it in GitHub Desktop.

Select an option

Save eightysteele/890567 to your computer and use it in GitHub Desktop.
// Setup app:
var mol = MOL(function(mol) {
bus = new mol.events.Bus();
api = new mol.ajax.Api(bus);
var config = {bus: bus, api: api, logging:true};
var app = new mol.app.Instance(config);
app.run();
return this;
});
// Add points:
var layer = new mol.model.Layer('points', 'gbif', 'puma concolor');
var request = {layer: layer, action:'load-layer'};
var failure = function(json){};
var success = function(json){};
api.execute(request, success, failure);
// Detele points:
bus.trigger('delete_layer', 'points_gbif_puma_concolor');
// Test ColorSetter
var color = new mol.core.ColorSetter.Color(1, 2, 3);
bus.trigger('set_layer_color', 'points_gbif_puma_concolor', color);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment