Wednesday, July 22, 2009

Custom marker generators

There are some fancy free services that generate custom marker icons for us. Google Chart API provides many useful labeled map pin types. Even tilted ones.

Graham has released a fascinating service that generates all the needed files from an image file of your own. You upload the image as png, gif or jpeg and instantly you can download a zipped package containing:
  • 24-bit png icon image
  • shadow
  • printImage
  • mozPrintImage
  • printShadow
  • transparent
  • imageMap array
Wou!

Monday, July 20, 2009

Drawing rectangles with V3

The experimental API v3 does not support polylines yet. We don't need polyline support for drawing simple rectangles. We can make browser to draw them.

BoundsBox for v3 is an extension that takes LatLngBounds object as an argument and draws the bounds on map. A DIV is created and made an OverlayView overlay object.

Styling of the rectangle is made with CSS. You can put text content also and even a background image. 'click' event is available, 'mouseover' is easily attached.

See the example that visualizes bounds that v3 geocoder returns.

Monday, July 13, 2009

Location by browser

Now we have two browsers that provide client location by JavaScript API, Firefox 3.5 and Google Chrome.

FF3.5 supports W3C specification (draft) and provides navigator.geolocation object. The objects getCurrentPosition() method returns coordinates and even heading and speed properties.

Chrome provides geolocation object by built in Google Gears.

Actually other browsers return the location too with Google Gears installed.

Test and read more from the links of this page. The page is the first one that I set sensor=true.