天道酬勤,学无止境

google-map-place

Google Map add marker using place ID

I am trying to place a marker into Google Maps using its PlaceID. I have the map working and displaying and can also add markers (using Lattitude and Longitude) into it. The code below is what I am using to try and make the marker display using its placeID however it is not displaying. function addPlaces(){ var marker = new google.maps.Marker({ place: new google.maps.Place('ChIJN1t_tDeuEmsRUsoyG83frY4'), map: map }); } This function is called after the map has loaded. google.maps.event.addDomListener(window, "load", addPlaces);

2021-05-17 08:32:24    分类:问答    javascript   google-maps   google-maps-api-3   google-maps-markers   google-map-place