Module Template: Simple button

From MapbenderWiki

Jump to: navigation, search

This is a tutorial for Mapbender 2.7 and newer (note: this equals trunk at the moment, September 2009).

Contents

Requirements

This tutorials build upon "How to Write a Mapbender module". Make sure to have read it.

Objective

Create a new module for Mapbender, which is a simple button. On mouse over, the button is highlighted. On click, a specified action is executed.

Template

$(this).click(function () {
	//
	// enter your code here
	//
}).mouseover(function () {
	if (options.src) {
		this.src = options.src.replace(/_off/, "_over");
	}
}).mouseout(function () {
	if (options.src) {
		this.src = options.src;
	}
});


Recommended further reading

Views
Personal tools