Hi!
I found some code that I find useful, but I don't understand it 100%.
var marker = createMarker(position,'Plats 1')
Could someone tell me how this works? First is a declaration of the
variable marker, the next part call a function with some value. But
then, why this combination? whats the point? And in the function
below, var marker is declared once again and is old value gone or? How
does it work? Like to know what i'm doing! Thanks!
// place markers
var position = new google.maps.LatLng(56.8848, 14.7730);
var marker = createMarker(position,'Plats 1')
var position = new google.maps.LatLng(57.1719, 14.3701);
var marker = createMarker(position,'Plats 2');
function createMarker(latlng, name) {
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: name
});
}
--
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.