Google Maps, like any other Google product is already easy-to-use and their API is not that complicated to work with.
However, things can always be simpler and GMaps.js, a feature-rich jQuery plugin, helps consuming Google Maps much easier.
Besides adding a standard map of a specific location, we can define the zoom level, add markers, get the location of a user (HTML5 geolocation), define routes, draw polylines and more with only few lines of code.
And, it has callbacks on every action to integrate any custom events. GMaps.js is not documented in detail, however, it has examples of each feature.
Compatibility: All Major Browsers
This is a guest post by Phil Leggetter from Pusher
(an HTML5 WebSocket-powered realtime messaging service).
The purpose of this tutorial is to show how to create a realtime location aware visitor tracker for a web site or application.
When a visitor navigates to the page on your site, or accesses your mobile web app, the visitor tracker will display the new visitor hit in realtime, displaying the page they've landed on and where each visitor is on a Google map (lat/long and locality). For the purposes of the tutorial, we'll write our server code in PHP, but you could use any server side language you like.
Here is how the end result will look like:
Here's the order in which we'll cover things:
- Get the basics out of the way
- Connect to Pusher
- Subscribe to new visitor page hits notifications
- Get the visitor's location using the HTML5 Geolocation API
- Broadcast the visitor location and page to all application visitors using Pusher
- Display the visitor location and page information on a Google map
Read the rest of this entry »
Requirements: Pusher Account
Compatibility: All Modern Browsers
jQuery Geo is a plugin for the popular framework that provides an easy-to-use API for map/geolocation related actions.
The plugin uses the open source map servers like Open Street Map, WMS and Esri ArcGIS (Open Street Map by default) for pulling the map data and can:
- show mapping data and handle direct user interaction with the map
- use geospatial functions like calculating bounding boxes, measuring the distance between geometries, etc.
The maps created are mobile-friendly and have lots of built-in methods for customization.
jQuery Geo is very well-documented and supported with a bunch of examples.
Compatibility: All Major Browsers
SimpleGeo is a free service which makes creating location-aware applications so simple.
A powerful API & SDKs for various languages exist to easily communicate with the service.
It has 2 free services:
Using SimpleGeo Context, you can get many details by providing a latitude/longitude like the name of the location, its weather, geographic features, etc.
It is the world's first open POI (point of interest) data which is maintained by SimpleGeo to make sure it is accurate.
Using SimpleGeo Places, it is possible to learn shopping centers, gas stations, movie theaters, etc. around any given location.
Both services are 100% free with no usage limits.
MooGeo is a MooTools plugin that makes accomplishing common geolocation tasks easy.
These tasks include getting detailed info about an IP (country, city, longitude, latitude, etc.), parsing geographical data from text and even finding Flickr photos about a given place.
The plugin makes use of multiple free-to-use services like:
- Yahoo PlaceMaker
- Yahoo GeoPlanet
- W3C Geo location
and wraps them into a single package.
MooGeo has also support for events on every level (when a request is sent, completed, success or error) which helps offering a better experience to end users.
GeoNames is a set of free and downloadable geographical databases of all countries which includes over 8 million place names.
The data comes in tab-delimited + utf-8 formatted text files and can be downloaded as a whole or per country.
Besides the locations of the places/cities/countries, databases include supplementary data like capitals, statistics, timezones and more.
GeoNames data can also be reached from their free webservice which can return results in XML and JSON.
Geolocation is one of the most popular subjects for today's web & there are many solutions that help geo-enabling web applications.
It has various powerful features like:
- detecting the visitor’s location with the W3C geo API and with IP as a fallback
- find geo location from text
- find location from lat/lon pair
- find locations in a certain web document (by URL)
- get the location for a certain IP number
The library is lightweight (4kb uncompressed) & non-complicated. It just works by calling a function like:
alert(o.place.name + ',' + o.place.country.content +
' (' + o.place.centroid.latitude + ',' +
o.place.centroid.longitude + ')'
will get you the city, country, latitude & longitude of any given IP.
Requirements: No Requirements