Saturday, May 1, 2010

Re: Export functions into separate file (-->Prototype)

> I would like to draw a rectangle. Therefore I wrote these functions
> below (at the moment this function draws a parallelogram…)

You might like to look into map projections etc. (the API uses
Mercator)
It's not a simple X/Y grid

> Now I
> would like to export these functions into a separate*.js-file, but how
> can I do this

Just put them in a file and include its URL in <script> tags
http://www.quirksmode.org/js/placejs.html
Because your script uses API Gxxx functions, you'd want to do that
after the call to the API itself

> (I`ve heard about prototyping - but I didn´t know, how
> it works)?

You don't have to go that way, you can just call your new functions
from your main script, but if you want to -
http://www.google.com/search?q=javascript+prototyping+tutorial

--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate