2,733
edits
Red Leader (talk | contribs) |
Red Leader (talk | contribs) |
||
Line 297: | Line 297: | ||
}; | }; | ||
# | # This function will be called whenever an item is added | ||
var added = func(apt){ | var added = func(apt){ | ||
print("Airport ", apt.id, " added"); | print("Airport ", apt.id, " added"); | ||
} | } | ||
# | # This function will be called whenever an item is removed | ||
var removed = func(apt){ | var removed = func(apt){ | ||
print("Airport ", apt.id, " removed"); | print("Airport ", apt.id, " removed"); | ||
} | } | ||
# | # Create a new object, passing to it the search function to be used and the callbacks | ||
var searcher = geo.PositionedSearch.new(searchCmd, added, removed); | var searcher = geo.PositionedSearch.new(searchCmd, added, removed); | ||
# | # Actually update the searcher object | ||
searcher.update(); | searcher.update(); | ||
}} | }} | ||
Line 344: | Line 344: | ||
}} | }} | ||
==== _equals ==== | ==== _equals ==== | ||
{{Nasal doc | {{Nasal doc | ||
|syntax = geo.PositionedSearch._equals; | |syntax = geo.PositionedSearch._equals; | ||
|text = Function that checks if two objects are equal. You must redefine this function to use <code>geo.PositionedSearch</code> for other uses | |text = Function that checks if two objects are equal. You must redefine this function to use <code>geo.PositionedSearch</code> for other uses. | ||
|example1 = var searchCmd = func(){ | |example1 = var searchCmd = func(){ | ||
var vec = []; | var vec = []; |