Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
Highlight an existing business on Google Maps API

I have a list of store addresses, and I'm trying to create a map out of it. Using the Places API I am able to retrieve most of the informations and manually create and place the markers on the map:

const service = new google.maps.places.PlacesService(map);
service.findPlaceFromQuery({
  query: '212 Enterprise Dr, Rockaway, Frank Pizza',
  fields: ['all']
}, onPlaceFound);

However I'd like to select the original marker instead of overlapping a new one.

That is because I want the user to be able to open the default info window with store phone number, directions and stuff.

I know that I can re-create it, but it feels kinda lame since all the info is already there.

Original GM Marker Custom Marker

This SO post ask about the same, yet no solution has been found.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Based on the documentation found here, which shows findPlaceFromQuery(), the second parameter of findPlaceFromQuery should be a function where the first argument of that function is an Array of placeResults.

Therefore, after reviewing a link here and here your onPlaceFound function should be looking something like:

function onPlaceFound(placeResultsArray){
  const firstResult = placeResultsArray[0], firstIconURL = firstResult.icon;
  const latLng = firstResult.geometry.location, lat = latLng.lat(), lng = latLng.lng();
  // do stuff with those variables here
}
  

Of course, that does not select Google's result as a Marker, but now you have the actual icon, and latitude and longitude.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!