I have a map, which populates markers based on search. I’m attempting to user the newer google maps feature AdvancedMarkerView so I can fill it with custom HTML – however, as my search updates, I want to flush the old markers and place new ones when it’s called for…and I can’t for the life of me figure out how to?
Tag: google-maps-api-3
Same array inside of useEffect and getCoordinates is different when console.log
Using GoogleMap API to display custom locations I have an array of json object called data imported; it has a property called address. Google map api looks up coordinates of the address property and should generates custom Markers from an array called locations. But the value of locations inside fetchLocations() and getCoordinates, are different when I console.log, although the both
Google Maps Filter Javascript
Looking for a way to filter the map markers using pure javascript based upon multiple conditions if they exist. This is based upon having potentially 4 potential filters possible. So imagine I have two or more field sets Project Type (this will be an array of project types [‘engineering’,’construction’]) Region (this will be an array of regions [‘France’,’Italy’]) Name (this
Google Places Autocomplete API – Abbreviate Cardinal Direction on input
I’m using Google Places Autocomplete for looking up addresses, and I want users to be able to type abbreviations for the cardinal directions in their street addresses. For example, my users have to type “north” out completely (eg 123 “north” willow lane), instead of just “n” (eg 123 “n” willow lane). Users try to type “n” “s” “e” “w” most
Draw Lines between Multiple markers on Google Map
I am little new in JavaScript and Google Map. I am trying to draw lines between my multiple location. I am following this example. My Code is like this Its showing places fine and without issue. Its just not drawing the lines. I am getting error like below I am not getting idea what I should do for fix the
How to implement google map places autocomplete in Javascript?
I am trying to implement google map place autocomplete api in my application. My code is as below- I am trying to give suggestions on addresses on keypress event after user presses each character in the input field like below image in official documentation- But I am facing following error in my console- Uncaught (in promise), message: “autoAddress is not
Map markers not clustering
I have a map which has multiple markers within close proximity of each other. Trying to integrate the marker clustering through google dev kit. However the clustering is not occuring, and am also not getting an error in console – which makes it somewhat tricky. Map data being used: Javascript: Which is displaying the map in html via the div
How to change marker label color of react-google-maps
I am using @react-google-maps/api library. I’ve integrated google map but I am facing marker label color, I tried very hard but didn’t find any solution. Could someone please help me with how to resolve this issue. Answer Try this: label: {text: `${id}`, color: “blue”}
Multiple tile issue google maps API v3 JS
I have a map where user from an admin panel can add many tiled layers to the map. Those layers will be added to the map in the form of loop. The user can switch the layer on and off based on their selection. After adding the layers via the loop when I select the first layer the second layer
Change icon back to default state after infoWindow closed Google Maps
So my goal here is to make the icon go from the “normalIcon” state to the “activeIcon” state on button click, which it currently does. It opens an infoWindow when the pin is clicked as well. I want the icon to go back to the “normalIcon” state when the infoWindow is closed. Right now, if you click on a different