You are looking at posts in the category dev.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Feb | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
Posted on February 22nd, 2010 by thiswayup.
Categories: dev.
Just to remind myself how to capture the event when the map is dragged AND work out the distance to a previously recorded center point on the map
GEvent.addListener(gmapFn.mapObj,'dragend',function(){
var ctrLatLng = gmapFn.mapObj.getCenter();
alert(ctrLatLng.distanceFrom(gmapFn.lastRefLatLng));
});
Very handy! gmapFn.mapObj = the object of the instianted gmap object and gmapFn.lastRefLatLng is a GLatLng. You can quickly get the center of a google map by calling the function gmapObject.getCenter() which returns the center as a GLatLng.
Enjoy!
Update : handy refrence of all the events you can to a google maps listener http://econym.org.uk/gmap/gevent.htm
Posted on January 25th, 2010 by thiswayup.
Categories: dev.
I've been seeing alot of php/web dev best practices recently and I'm always looking at whats the "best" way to do things …just so that I can be a lazy ass over the long term and not have to go back (and fix) potentially naff code
Here is a small collection of them that has ended up in my delicious bookmarks.
Posted on November 30th, 2009 by thiswayup.
Categories: dev.
Just for my own personal reference. Here’s a quick list of the different types of variables in Modx.