We prefer the utility libraries don't use the same namespace as the API to avoid confusion between open source libraries and the core API.
-- Luke On Thu, Mar 31, 2011 at 9:20 PM, en4ce <djen...@googlemail.com> wrote: > good work and thoughts, keep it comming > > i tested the map.setMapTypeId(GoogleEarth.MAP_TYPE_ID); and it works > like the old version "map.setMapTypeId('GoogleEarthAPI');" > but shouldn't it be something like > "map.setMapTypeId(google.maps.MapTypeId.EARTH);" or am i missing > something there ? > > thanks josh > > -- enrico > > On 31 Mrz., 02:16, Josh L <jli...@google.com> wrote: > > Hi all, > > > > I've just pushed a minor update to this library that > > - protects setMapOriginal_ > > - provides a MAP_TYPE_ID constant you can use, a la: > > map.setMapTypeId(GoogleEarth.MAP_TYPE_ID); > > - updates the reference html > > > > I'm not around the rest of this week but next week I'll look at some > > of the other issues/requests, such as maps that have disabled the > > mapTypeControl or have non-default map types. My intention is to > > continually improve this library over the coming months, so your > > feedback is always appreciated. > > > > Cheers, > > > > -Josh > > > > On Mar 26, 8:49 am, Josh L <jli...@google.com> wrote: > > > > > > > > > > > > > > > > > Hi Nianwei, > > > > > Thanks for the detailed feedback, greatly appreciated. I was unable > > > to replicate the issue you were having in Firefox, can you tell me the > > > version and operating system you are using? > > > > > Also you make a great point that the setMapOriginal_ method should > > > have been protected; I will get a fix out for this shortly. > > > > > Cheers, > > > > > -Josh > > > > > On Mar 25, 1:35 pm, Nianwei Liu <nian...@gmail.com> wrote: > > > > > > One more observation: > > > > > > This lib used a unique (and clever) technique to track overlays been > > > > added to the map instance. It overwrites the Class.prototype.setMap > > > > method by creating an alias pointer to the original function and call > > > > it afterward using the alias. There is a potential risk introduced by > > > > the closure compiler. There are other forum posters pointed this out > > > > the closure forum before, so I just repeat here using this example: > > > > > > The compiler renamed "setMapOriginal_" in the compile process, in the > > > > actual result, it became google[B][a][E].q=google[B][a][E].setMap; > > > > Now, there is no guarantee that it will always be renamed to "q" > > > > because the compiler make decision based on the code. Hypothetically, > > > > it can be renamed to something like "l". > > > > Here is the problem: if the core API class has already have something > > > > called "q" or "l", it will break. Since the core API is compiled > > > > independently from this lib, future release can break it. I was able > > > > create a sample just demo that. > > > > > > I renamed the "q" method to "l" in the compiled code (again, it > > > > entirely possible for the compiler to produce it but I did it for > demo > > > > purpose). Now check this link: > > > > > > > http://gmaps-utility-gis.googlecode.com/svn/trunk/v3test/earthv3/eart... > > > > > > This link loads API 3.2. Now click through the top link to load > > > > different version of core API, you will see 3.3 works fine, but, the > > > > KML layer (Chicago transit) broke in 3.4. It's because there is an > new > > > > "l" function in the KMLLayerOverlay class introduced in 3.4 that > > > > clashed with the earth lib code. > > > > > > So, I think setMapOriginal_ method probably should be protected using > > > > quote so the compiler would leave it along, assuming the core API > will > > > > never have something called setMapOriginal_. > > > > > > On Mar 25, 3:38 pm, Nianwei Liu <nian...@gmail.com> wrote: > > > > > > > Josh, > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To post to this group, send email to > google-maps-js-api-v3@googlegroups.com. > To unsubscribe from this group, send email to > google-maps-js-api-v3+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.