Ascalc Update: Location
by freelynx
February 25, 2011.
Crap it’s been a month already!
It looks like the plan to make a presentation about Ascalc have to be postponed. Things get really tricky when starting working on the detail. I have just finish working on the location.
Now, Ascalc is be able to get user location. The users have three option in order to select their location. Considering user might be in Observatorium, Planetarium, University, or even in other part of the world. I think this is covering all aspect not just place where academia might stand but also other part of the earth.
Some interesting functionalities in this feature, to name a few:
- Integration of Google Earth so user is able to explore the exact location. Google Earth helps user to get Longitude and Latitude of any place on Earth, efficiently (despite the fact that this makes the app spending more resource, especially the memory)
- Users are able to find data of observatorium, planetarium, or university once they type in the input box. Hence, no need to insert the data of longitude, latitude, height, and GMT offset into the fields. However, this has impacted the app to provide complete data of these places.
- Ascalc provides the ‘Synchronize’ link which has the ability to synchronize user location between inside the database and the one that is stored in the cookie. Of course, the one that is being a reference is the database. This functionality based on the notion that a user might be change the PC but not a location, so he/she does not need to set the location again.
Some bugs are detected during the developments which are the following:
- When I upgrade jQuery from 1.4.2 to the latest (1.5.1), there’s a problem with plugin $.cookie. One thing that is weird happened when I copied and pasted the compressed jquery v1.5.1 to my PSPAD, somehow the last part of the code appeared to be a comment. Not sure if this is really a bug for a jQuery v1.5.1 but just to be saved, I downgrade my jQuery to the previous ones, v1.4.2.
- When user is finishing using Google Earth and updating the new location, the loading status appeared behind the area of Google Earth API. I tried to set z-index to 99999 for the loading status but yet to be working. Oh well, just leave it to Yudiacro, hehe!
The original idea of Location on Earth was as follows:
- Determine the Longitude and Latitude from Google Earth
- Use the Long and Lat and pass them to Google Maps to get the ‘exact’ City and Country.
- By using the information of City and Country, these variable can be passed to yahoo weather app in order to get current local weather and GMT Offset.
If I nailed it, this could be a good combination between two web services. However, the problem occurred during step 2. I don’t know why, but my $.get or $.getJSON somehow cannot grab the responds data from Google Maps API. Seriously frustrated, I decided to let users to define the information themselves. This quite ugly, but I think it’s probably all right for milestone 1.