It sounds like you're using the Closure Compiler, and you're concerned that your code's obfuscated properties will collide with GM compiled properties. Property collision is not usually a problem, but there are a few cases to watch out:
1 - You're subclassing/extending GM objects. We don't recommend that precisely to avoid property collisions. Instead we recommend composing objects: for example a Shape object could contain a google.maps.Polygon object rather than extending google.maps.Polygon. 2 - You're extending the JavaScript Object or Array prototypes. We don't recommend you do that, to avoid property collisions. 3 - You're setting properties on GM objects. In that case you want to avoid obfuscation. For example: --- Bad --- var polygon = new google.maps.Polygon(...); polygon.myId = 5; // For later identification in an event handler ------ --- Good --- var polygon = new google.maps.Polygon(...); polygon['myId'] = 5; // For later identification in an event handler ------ In the "bad" code, .myId may be obfuscated to collide with an obfuscated property of google.maps.Polygon. In the "good" code, the Closure Compiler will not obfuscate 'myId', so it will not accidentally collide with obfuscated API properties. - Ben On Mon, Nov 1, 2010 at 3:11 AM, Andre Tannus <[email protected]> wrote: > I don't want to append my own properties to the GM objects and run the risk > of google employees using the same prop name in the future, and have to deal > with collision. Also, by wrapping the GM objects, I'm able to provide > interfaces to GM objects, and, in the future, make the app "Map Agnostic", > if you will. > > But, like I said in the original post, I'm kind of new to JS. It keeps > kicking me in the head, but I'm developing a rather exotic taste for it. > It's freakishly flexible, plus, combined with the Closure Library, it's like > playing with clay. > Either way, I hope I answered your question, and if I'm off the tracks > (which is likely), by all means, let me know! > Who where you, at GDDBR? I didn't talk to that many people, so it won't be > hard to remember! > > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
