update examples

This commit is contained in:
rolux 2012-05-27 21:37:00 +02:00
parent 5a07fc2519
commit 7240cf2c38
2 changed files with 7 additions and 8 deletions

View file

@ -51,7 +51,7 @@ Ox.load('Image', function() {
/* /*
Ox.getXYByLatLng takes a lat/lng pair and returns its x/y position on a Ox.getXYByLatLng takes a lat/lng pair and returns its x/y position on a
1x1 Mercator position, <code>{x: 0, y: 0}</code> being the bottom left, 1×1 Mercator position, <code>{x: 0, y: 0}</code> being the bottom left,
<code>{x: 1, y: 1}</code> being the top right. <code>{x: 1, y: 1}</code> being the top right.
*/ */
function getXY(point) { function getXY(point) {
@ -87,12 +87,10 @@ Ox.load('Image', function() {
parts[0].push({lat: lat, lng: lng[0]}); parts[0].push({lat: lat, lng: lng[0]});
parts[1].unshift({lat: lat, lng: lng[1]}); parts[1].unshift({lat: lat, lng: lng[1]});
/* /*
Returning false from Ox.loop is the equivalent of Ox.Break() breaks the loop. Again, note that this assumes no
<code>break</code> in a <code>for</code> loop. Again, note path will cross the edge more than once.
that this assumes no path will cross the edge more than
once.
*/ */
return false; Ox.Break();
} }
}); });
/* /*

View file

@ -211,7 +211,7 @@ Ox.load('Image', function() {
Before we start drawing, we define a few helper functions. Before we start drawing, we define a few helper functions.
<code>getXYByLatLng</code> returns screen coordinates for a given point. <code>getXYByLatLng</code> returns screen coordinates for a given point.
We use Ox.getXYByLatLng, which takes a lat/lng pair and returns its x/y We use Ox.getXYByLatLng, which takes a lat/lng pair and returns its x/y
position on a 1x1 Mercator position, with <code>{x: 0, y: 0}</code> at the position on a 1×1 Mercator position, with <code>{x: 0, y: 0}</code> at the
bottom left and <code>{x: 1, y: 1}</code> at the top right. bottom left and <code>{x: 1, y: 1}</code> at the top right.
*/ */
function getXYByLatLng(point) { function getXYByLatLng(point) {
@ -221,7 +221,8 @@ Ox.load('Image', function() {
} }
/* /*
<code>getLatLngByXY</code> is just the inverse, just like Ox.getLatLngByXY. <code>getLatLngByXY</code> is the inverse of the above, just like
Ox.getLatLngByXY.
*/ */
function getLatLngByXY(xy) { function getLatLngByXY(xy) {
return Ox.getLatLngByXY(Ox.map(xy, function(v) { return Ox.getLatLngByXY(Ox.map(xy, function(v) {