com/libs/google_js_api
Differences between version #8885 and #8886
1c1 < This library contains extern classes that allow static type checking and compilation for various Google javascript API's. Currently, it contains the base google loader class, which is documented [[http://code.google.com/apis/ajax/documentation/|here]]. --- > This library contains extern classes that allow static type checking and compilation for various Google javascript API's. Currently, it contains the base google loader class, which is documented [[http://code.google.com/apis/ajax/documentation/|here]], as well as a full specification for the Google Earth API. It is currently in a very early stage of development. 4c4 < Many of Google's javascript types and methods are given "nice" namespaces. However, in many cases, they differ from how Haxe treats class and instance naming. The first issue is with the base loader functionality, given by google.load(). "google" in this case behaves like a variable containing a few static methods, one of which is a load method. Later on, the "google" namespace is introduced, with sub packages like google.maps, and google.search. This confuses completion for packages in Haxe. --- > Many of Google's javascript types and methods are given "nice" namespaces. However, in many cases, they differ from how Haxe handles class and instance naming. The first issue is with the base loader functionality, given by google.load(). "google" in this case behaves like a class containing a few static methods, one of which is a load method. Later on, the "google" namespace is introduced, with sub packages like google.maps, and google.search. This confuses completion for packages in Haxe. 6c6 < Using some initialization magic, the "google" instance variable gets assigned to "Google", which fits with the standard Haxe method of naming classes and handling static methods. --- > Using some initialization magic, the "google" instance variable gets assigned to "Google", which fits with the standard Haxe method of naming classes and handling static methods. 7a8,16 > The "google.setOnLoadCallback" function fires when the entire page is loaded. It is also overloaded at runtime so that api classes can have their namespaces automatically fixed if the original google api is loaded asynchronously. > > Note: There is another callback function option which fires when just the javascript is loaded. This function is //not// overridden. > > ====== Enums and Initialization Objects ====== > Javascript enums (simple constrained sets of integers or strings) are not currently possible for Haxe to support as an extern. They are typed as simple base types such as String or Ints. > > Javascript initialization objects are hashes of string keys and values. They are typed as simple Dynamic<Dynamic> objects in the extern. > 9c18,19 < Google earth does not currently have a well behaved namespace, so unfortunately most classes exist in the base package. Once again, the google.earth instance and functions are mapped to the Earth class as "google.Earth". The main instance creation function becomes: --- > Google earth does not currently have a well behaved namespace, so unfortunately most classes exist in the base package. Once again, the google.earth instance and functions are mapped to the Earth class as "google.Earth". > More details about the API itself are given on the Google Earth [[http://code.google.com/apis/earth/documentation/reference/index.html|API page]]. 10a21,22 > The main instance creation function becomes: > 15d26 < This is managed with more initialization magic, and will happen automatically 18a30,31 > >
| Ver | Date | Lg | User | Action |
|---|---|---|---|---|
| #8892 | 2010-07-15 07:29:50 | en | jjdonald | View | Diff |
| #8891 | 2010-07-15 03:25:58 | en | jjdonald | View | Diff |
| #8890 | 2010-07-15 03:25:02 | en | jjdonald | View | Diff |
| #8889 | 2010-07-15 01:34:18 | en | jjdonald | Changed title from google-js-api : The Google Javascript API Extern to google-js-api |
| #8888 | 2010-07-15 01:31:30 | en | jjdonald | View | Diff |
| #8887 | 2010-07-15 01:30:50 | en | jjdonald | View | Diff |
| #8886 | 2010-07-15 01:30:33 | en | jjdonald | View | Diff |
| #8885 | 2010-07-15 01:12:45 | en | jjdonald | View | Diff |
| #8884 | 2010-07-15 01:12:45 | en | jjdonald | Set title to google-js-api : The Google Javascript API Extern |
Previous | Next