Yes i understaaaaaaaaaaaaaaaand that! Again, i want to change my
method to a RETURNER (in this case return marker)

but my problem is that stupid point-thing.

 function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

 var point = new GLatLng(43.65654,-79.90138);
      var marker = createMarker(point,'<div style="width:240px">Some
stuff to display in the First Info Window. With a <a href="http://
www.econym.demon.co.uk">Link<\/a> to my home page<\/div>')
      map.addOverlay(marker);


thats the whole thing i know, and now i don't have the POINT! Can
anyone tell me how to get the point (GLatLng) from the adress( street,
postal-code, cityname)?
if i have that, i could make this:
var marker = createMarker(point, html);

you understand what i mean?

On 30 Nov., 12:41, Andrew Leach <[email protected]> wrote:
> On Nov 30, 11:18 am, Emre Avsar <[email protected]> wrote:
>
> > Yeah but, how??
>
> > look at my function please createMarker();
>
> Why don't you have a look at Mike's, as suggested 
> earlier?http://econym.org.uk/gmap/basic1.htm
>
> You should find a fairly crucial "var" keyword which makes a variable
> local. Your createMarker() function doesn't have that. Unfortunately
> when people diverge from that example things tend to go wrong. What
> you *should* be doing is using the createMarker() function to create
> and return a marker which the calling routine deals with. Don't try
> dealing with the marker in the function which creates it.
>
> A potential shortcoming of Javascript is its use of "function" to
> define real functions which return something, and also to define
> *subroutines* which don't. It's easier to make routines which create
> an object into real functions which return that object, and then
> routines which don't create objects but merely handle them can be
> treated as subroutines.
>
> Andrew

--

You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-api?hl=en.


Reply via email to