Custom JavaScript events

So, you want to trigger an event when something happens in you javascript code? There might be better ways to do it, but here is the solution that I use for my code which is pretty light and easy to understand. Read the full article ...

Make LineString resolution depend on zoom level in OpenLayers

So, you want to render a route on your OpenLayers map? Everything will be nice and sweet until you’ll have to render a huge route, in which case no matter what computer your clients have, most probably it will stall. To solve this you have two possibilities: you either reduce the number of lines you send from the server or you reduce the number of points rendered directly on the client’s browser.

Both solutions will raise a problem: if the user will zoom deep enough, they will see a discrepancy between the route and the road (the number of points in the route will not be equal with the number of point on the road). So, the round may do a turn where your route plotting will just cut the corner. To solve this, I found a very adaptive solution that will reduce the number of point in your route the further you zoom out. Read the full article ...