Qibla Locator
I’ve been working on a little project utilizing the google maps api to make a Qibla direction locator. It works almost exactly like google maps except that it displays an overlay pointing towards the Qibla. The direction in degrees from North is also given at the bottom of the page. Another one of the nice features is a map-in-map view much like pic-in-pic view found on most new TV sets. As this is pretty much a work in progress, I’m sure you’ll notice many bugs. Please do let me know.
Check out the Qibla Locator and take a look for your self. Be sure to leave your comments.
Note: May not work on Safari
UPDATE SEPT 24 2007:
Beta 0.8.10:
- Fixed critical bug that introduced a variance of upto 12 degrees in drawing qibla direction line in certain places. Thanks to Dr Hamed Zarrabi-Zadeh of University of Waterloo for discovering and fixing the issue.
- Code rewrite and cleanup provided by Dr Hamed Zarrabi-Zadeh.
- Removed zoom level indicator from interface as it was of no real use.
UPDATE JUN 21 2006:
Beta 0.8.9:
- Fixed problem with direction polylines due to changes in google maps api
- Added Googles own geocoder
- Added option to view distance from Mecca in miles or kilometers
- Fixed direction and coordinates output to 5 decimal places
UPDATE MAY 08 2006:
Beta 0.8.8:
- Fixed IE layout issues
- Fixed incoherrent results in direction between IE and Firefox due to display issues
UPDATE APR 27 2006:
With the new Google Maps API v2 released, I decided to update the Google Maps Qibla Locator with quite a few exciting new features. First and foremost is the ability to search by address using AJAX! This is possible thanks to the Yahoo! Geocode API. You can not only search by address but also by zipcode, city, state or even just country (address and zipcode work only in the US). Different search queries provide different zoom levels. The more precise the query, the more zoomed in the view will be. This is usefull as it can speed up the process in locating a place.
Also added is the distance to the Qibla. As noted in the API documention, this distance could be off by as much as 0.3% but is still a good estimation.
Another little feature that was added has to do with the UI/usability. You will note that the map controls only appear when the mouse is on the map and they disappear when it is not. This enables the user to have a full unobstructive view of the map.
New in Beta 0.8.7:
- Updated to Google maps APIv2.
- Replaced Overview Pane with official collapsible version.
- Added Yahoo! geocoding.
- Added distance to Mecca.
- Added mouseover map controls.
- Added zoom level indicator.
References / Credits
http://www.islamworld.net/qibla.html – Qibla direction algorithm
http://www.cs.uwaterloo.ca/~hzarrabi/home – Critical bug fix and extensive code cleanup