1
0
Fork 0
forked from 0x2620/oxjs

minor changes in OxJS

This commit is contained in:
rolux 2012-01-06 17:27:54 +05:30
commit f76ee0cf36
6 changed files with 16 additions and 6 deletions

View file

@ -19,6 +19,10 @@
/*@
Ox.crossesDateline <f> Returns true if a given line crosses the dateline
> Ox.crossesDateline({lat: 0, lng: -90}, {lat: 0, lng: 90})
false
> Ox.crossesDateline({lat: 0, lng: 90}, {lat: 0, lng: -90})
true
@*/
Ox.crossesDateline = function(pointA, pointB) {
return pointA.lng > pointB.lng;
@ -53,6 +57,8 @@
Ox.getBearing <f> Returns the bearing from one point to another
> Ox.getBearing({lat: -45, lng: 0}, {lat: 45, lng: 0})
0
> Ox.getBearing({lat: 0, lng: -90}, {lat: 0, lng: 90})
90
@*/
Ox.getBearing = function(pointA, pointB) {
var pointA = rad(pointA),
@ -209,6 +215,8 @@
/*@
Ox.isPolar <f> Returns true if a given point is outside the bounds of a mercator projection
> Ox.isPolar({lat: 90, lng: 0})
true
@*/
Ox.isPolar = function(point) {
return point.lat < Ox.MIN_LATITUDE || point.lat > Ox.MAX_LATITUDE;