The Google Maps Embed API will show the text label for the place ID you specify on the shown map as a standard place label. For example:
Embedded Map
<iframe width="1000" height="1000"
src="https://www.google.com/maps/embed/v1/place?q=place_id:ChIJU6l0ESZu5kcReX4mEjfmJnY&key=YOUR_KEY">
</iframe>
Javascript Map
In contrast, using the Google Maps JavaScript API, if I place a marker on a map using the somewhat undocumented place
parameter (not mentioned in MarkerOptions BUT shown in Example using the Places library in the Maps JavaScript API )
...
let marker = new google.maps.Marker({
map: map,
place: {
placeId: "ChIJU6l0ESZu5kcReX4mEjfmJnY",
location: place.geometry.location
}
});
gives the following:
Is there a way to get the Google Maps JavaScript API to show the official place label next to a Marker the way that it does in the embed API? Specifically, looking for red text with white outline, as shown in the embed api example above, and collision avoidance behavior (avoiding overlapping labels).
*The question is similar to the "duplicate" question, but the answer to that question doesn't give the text the look of current google maps nor does it handle collision avoidance (nor does the asker seem to be looking for it)