2020年12月22日星期二

Google Maps JavaScript Api: How to add labels in respect of multiple search query result?

I have a code in maps JS api. I have 2 query search , one for finding near pharmacy, and other for hospitals. I want to label the returning markers with F for pharmacy and H for hospitals. How do I make this separation?

function addMarkerWithTimeout(position, timeout) {              window.setTimeout(() => {                  markers.push(                    new google.maps.Marker({                         map,                          position: position.geometry.location,                          animation: google.maps.Animation.DROP,                          title: "Farmacie",                          label: "F",                          label: "H",                        }                      )).addListener("click", toggleBounce());                                  }, timeout);          }    var request = {                  location: userPosition,                  radius: '2000',                  query: 'pharmacy',                  query: 'hospital',              };  
https://stackoverflow.com/questions/65417776/google-maps-javascript-api-how-to-add-labels-in-respect-of-multiple-search-quer December 23, 2020 at 08:57AM

没有评论:

发表评论