Note that there are some explanatory texts on larger screens.

plurals
  1. POReferencing a specific Google map marker
    primarykey
    data
    text
    <p>. .</p> <p>I've created a Google map (V3) that includes multiple markers. I've come across a need to redefine properties for specific markers. However, I have not been able to find any way to refer to specific marker objects.</p> <p>To give you an example of what I'm trying to do, let's say I have a US map onto which I've placed markers on New York, Chicago, and Los Angeles. Let's say I've defined them as follows:</p> <pre><code>var marker = new google.maps.Marker({map: map, position: lat-long-NY, title: "Yankees"}); // NY var marker = new google.maps.Marker({map: map, position: lat-long-Chi, title: "White Sox"}); // Chicago var marker = new google.maps.Marker({map: map, position: lat-long-LA, title: "Angels"}); // LA </code></pre> <p>Now, let's say I want to go back and <em>reset</em> the marker titles as follows:</p> <pre><code>google.maps.Marker({map: map, position: lat-long-NY, title: "Mets"}); // NY google.maps.Marker({map: map, position: lat-long-Chi, title: "Cubs"}); // Chicago google.maps.Marker({map: map, position: lat-long-LA, title: "Dodgers"}); // LA </code></pre> <p>So, how do I do this (or, for that matter, is it even possible)? I've tried putting the markers in an array and setting an ID for them, but to no avail. I've also thought about, but haven't tried, referring to them by their title (that's probably next), but I'm not even sure if this is possible. I have not been able to find anything like this in Google's documentation.</p> <p>Does anyone know if this is possible?</p> <p>Thanks in advance . . .</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload