->

30 October 2009

Google Maps JavaScript API v3 - Now with Directions

Google Maps JavaScript API v3 - Now with Directions

**Remember Google Maps JavaScript API v3 is designed to be super lightweight for mobile devices

This makes mapping for mobile devices a lot more useful

New Directions (Walking or Driving) in London - Google Maps API V3
New Directions (Walking or Driving) in London - Google Maps V3

@mapperz example above
http://mapperz.googlepages.com/google_mapv3_directions.html

With a Directions Panel
http://mapperz.googlepages.com/google_mapv3_directions_panel.html


Code:
New required parameters

var directionDisplay;
var directionsService = new google.maps.DirectionsService();

Set Start and End locations:

function calcRoute() {
var start = document.getElementById("start").value;
var end = document.getElementById("end").value;
var request = {
origin:start,
destination:end,

Travel Modes:

travelMode: google.maps.DirectionsTravelMode.WALKING
travelMode: google.maps.DirectionsTravelMode.DRIVING

Get the response from the Geocoder if both locations geocoded then display route between locations:

directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);


See the changelog
http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog

revelant links
Official documentation
http://code.google.com/apis/maps/documentation/v3/reference.html#DirectionsRenderer
http://code.google.com/apis/maps/documentation/v3/reference.html#DirectionsService

Offical Examples:
http://code.google.com/apis/maps/documentation/v3/examples/directions-simple.html
http://code.google.com/apis/maps/documentation/v3/examples/directions-panel.html

source:
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/ee7ce7cf8a872268?hl=en#

Labels: , , , , , ,

08 April 2009

Super Lightweight Spatial Database [SpatiaLite]

Superlight Spatial Database [SpatiaLite]

After a quick review of 'Free' Open Source GIS software. Had a look at Spatial Databases
There is a SpatiaLite - and it's easy to use 1,2,3 Go! (five minute guide)

What can you do quickly?
MBR [Minimum Bounding Rectangle] Example

What is an MBR? Above graphically shows the Bottom Left and Top Right of a rectangle using this as an extent to find spatial features within.This is one of the most basic ways to find something spatially.
More on MBR [Minimum Bounding Rectangle] Function [Wiki]

Spatialite MBR SQL Function
SQL request to find all features within the MBR

*Data used was OpenStreetMap in shapefile format
Not saying this is best spatial database out there but is certain to be the quickest to download,install and load data within it.

Features:
* Enhanced GUI tool v1.2
* SQL mathematical functions
* EXIF-GPS geometry-handling functions
* Virtual Table module VirtualNetwork
* Supporting routing [Dijkstra's Shortest Path algorithm]
* Supports importing and exporting to shapefiles [big plus]
* Supports standard WKT and WKB formats

Tutorials and Documentation to get you started.
http://www.gaia-gis.it/spatialite/docs.html

Why Super Lightweight? [8.3mb windows application] that's why.

Related links:
http://www.gaia-gis.it/spatialite/ [Main Homepage]
http://groups.google.com/group/spatialite-users?pli=1 [Google Group - Spatialite]

http://mapperz.blogspot.com/2008/09/open-street-map-in-shapefile-format.html
http://www.geofabrik.de/data/download.html [Open Street Map data in shapefiles]

Downloads
http://www.gaia-gis.it/spatialite/binaries.html [Applications for Mac,Windows,Linux]
http://www.gaia-gis.it/spatialite/resources.html [Sample Databases, Routing, Test Scripts]

Mapperz

Labels: , , , , , ,