google.wspl.Statement
google.wspl.Transaction
google.wspl.ResultSet
google.wspl.Database
google.wspl.DatabaseFactory
var database = google.wspl.DatabaseFactory.createDatabase('db name', 'http://yourdomain/dbworker.js');
var statement = google.wspl.Statement('SELECT col from test_table;');database.createTransaction(function(tx) { tx.executeAll([statement], {onSuccess: function(tx, resultSet) { // Statement succeeded. for(; resultSet.isValidRow(); resultSet.next()) { window.console.info(resultSet.getRow()['col']); } }, onFailure: function(error) { // Statement failed. }}); }, {onSuccess: function() { // After transaction commits, before any other starts.}, onFailure: function(error) { // After transaction fails, before any other starts.}});
$map_link = "http://maps.google.com/staticmap?key={$key}&size={$w}x{$h}¢er={$lat},{$lng}&zoom={$z}";
// a mercator object$mercator = new mercator();// we'll pan 1/2 the map height / width in each go // y pixel coordinate of center lat$y = $mercator->latToY($lat);// subtract (north) or add (south) half the height, then turn back into a latitude$north = $mercator->yToLat($y - $h/2, $z);$south = $mercator->yToLat($y + $h/2, $z);// x pixel coordinate of center lng$x = $mercator->lngToX($lng);// subtract (west) or add (east) half the width, then turn back into a longitude$east = $mercator->xToLng($x + $w/2, $z);$west = $mercator->xToLng($x - $w/2, $z);
$north = "http://maps.google.com/staticmap?key={$key}&size={$w}x{$h}¢er={$north},{$lng}&zoom={$z}";$south = "http://maps.google.com/staticmap?key={$key}&size={$w}x{$h}¢er={$south},{$lng}&zoom={$z}";$east = "http://maps.google.com/staticmap?key={$key}&size={$w}x{$h}¢er={$lat},{$east}&zoom={$z}";$west = "http://maps.google.com/staticmap?key={$key}&size={$w}x{$h}¢er={$lat},{$west}&zoom={$z}";