Fi156/leaflet — pull request #1 by fabianfetik (2014-11-27 21:15:59+00:00)
Title: fixed syntax errors & made mouseover/mouseout work

Things to note

```
function over(feature, layer) {
layer.on({
mouseover: info.update(feature),
mouseout: info.update();
^~~~~~~~~~
click: popup_poi(feature, layer),
});
}
```

Properties in object literals `{}` are comma-separated, a semi-colon here will throw a syntax error

`over` was used before it was assigned to. Thanks to variable hoisting in js this will not throw an error, it is actually defined, just with a value of `undefined` - therefore doing nothing. To avoid, always move all var declarations to the top of your function.

no:
```
over();

function over() {}
```

better:
(at the top of your function)
```
var x, y, over;
...
over = function() {}
```
doesn't matter if its a named or an anonymous function, so this is also ok:
```
over = function mynamedfunctionhere() {}
```

You can't control the arguments you're getting passed in callbacks (value of mouseover/mouseout) and you can't immediately invoke the function or the callback will be bound to its return value instead

(assuming `callback` is a function - or a pointer to a function)
yes:
```
mouseover: callback
```

no:
```
mouseover: callback()
```