Can't get Dynamic Google Map Markers to Show

Trying to get dynamic markers to work in Google Maps. Pretty sure I have the bindings correct cause if you look before the map, I rendered the addresses that should be the markers in a repeat just to make sure the data was returned as I expected it to but the markers don't appear. The map centers to the correct place though.

<dmx-google-maps id="mapsGlobal" dmx-bind:latitude="scSingleData.data.qSingleData.address_latitude" dmx-bind:longitude="scSingleData.data.qSingleData.address_longitude" dmx-bind:address="scSingleData.data.qSingleData.address_1+' '+scSingleData.data.qSingleData.address_2+', '+scSingleData.data.qSingleData.address_city+', '+scSingleData.data.qSingleData.address_state+', '+scSingleData.data.qSingleData.address_zip" dmx-bind:markers="scSingleData.data.qSingleData.em_services" marker-address="address_1+(!address_2?'':' '+address_2)+', '+address_city+', '+address_state+', '+address_zip" marker-label="em_service_name" marker-latitude="address_latitude" marker-longitude="address_longitude" enable-clusters="true">
      </dmx-google-maps>
      <div class="row mt-2" is="dmx-repeat" id="repeat1" dmx-bind:repeat="scSingleData.data.qSingleData.em_services">
        <div class="col-md-3">{{'Address: '+address_1+(!address_2?'':' '+address_2)+', '+address_city+', '+address_state+', '+address_zip+' Lat: '+address_latitude+' Long: '+address_longitude}}</div>
      </div>

Am I missing something simple?

Thanks in advance,
Twitch

What's the browser developers tools output show what the data looks like?

and what happens if you only send the long/lat and not address? You can put that in the title/text portion of the popup. the addresses have to be set to the long/lat if I remember there is a fee to use the address for the marker, or after you reached a limit. And you might have to actually turn that feature on in your google webmaster tools.

I use these functionality all the time. We should be able to figure this out easily.

Or maybe post the URL where we can look at it live?

Thanks for the replies @baub. Appreciate the help. It's on a local development server as of now so can't get to it from outside. This is my first time using the google maps component. I tried using the leaflet map with the dynamic markers but they didn't show either.

The data returned from from the server connect is correct or at least what I'm expecting.

{
    "job_site_id": 1,
    "job_site_name": "Test Job Site",
    "job_site_nearest_intersection": "maske rd",
    "address_id": 1,
    "address_1": "152 Windy Meadows Dr",
    "address_2": null,
    "address_city": "Schertz",
    "address_state": "TX",
    "address_zip": "78154",
    "address_latitude": "29.563189716764317",
    "address_longitude": "-98.28460150304767",
    "em_service_id": null,
    "em_services": [
        {
            "em_service_id": "1",
            "absolute_job_site_id": 1,
            "em_service_name": "City of Selma Texas Fire Department",
            "em_service_phone": "210-651-9150",
            "em_service_directions": null,
            "em_service_type": "Fire",
            "address_id": 2,
            "address_1": "9375 Corporate Dr",
            "address_2": null,
            "address_city": "Selma",
            "address_state": "TX",
            "address_zip": "78154",
            "job_site_id": null,
            "address_latitude": "29.5927054502711",
            "address_longitude": "-98.30561483188251"
        },
        {
            "em_service_id": "2",
            "absolute_job_site_id": 1,
            "em_service_name": "Schertz Police Department",
            "em_service_phone": "(210) 658-5321",
            "em_service_directions": null,
            "em_service_type": "Police",
            "address_id": 3,
            "address_1": "1400 Schertz Pkwy",
            "address_2": "#6",
            "address_city": "Schertz",
            "address_state": "TX",
            "address_zip": "78154",
            "job_site_id": null,
            "address_latitude": "29.565758920925067",
            "address_longitude": "-98.2696366011976"
        },
        {
            "em_service_id": "3",
            "absolute_job_site_id": 1,
            "em_service_name": "Guadalupe County Sheriff",
            "em_service_phone": "(830) 379-1224\n",
            "em_service_directions": null,
            "em_service_type": "Sheriff",
            "address_id": 4,
            "address_1": "2617 N Guadalupe St",
            "address_2": null,
            "address_city": "Seguin",
            "address_state": "TX",
            "address_zip": "78155",
            "job_site_id": null,
            "address_latitude": "29.60354255889758",
            "address_longitude": "-97.9694733778836"
        },
        {
            "em_service_id": "4",
            "absolute_job_site_id": 1,
            "em_service_name": "South Texas Spine And Surgical Hospital\n",
            "em_service_phone": null,
            "em_service_directions": "Directions to Hospital (attach map) :\nHead northwest toward Windy Meadows Dr (128 ft)\nTurn left at the 1st cross street onto Windy Meadows Dr (0.3 mi)\nTurn right onto FM1518 N (2.3 mi)\nTurn left onto Exchange Ave/I-35 N/I-35 Frontage Rd- Continue to follow I-35 N/I-35 Frontage Rd (1.1 mi)\nTake the ramp on the left onto I-35 S (0.9 mi)\nTake exit 172 toward TX-1604 Loop W (0.1 mi)\nSlight right onto the TX-1604 Loop W/Anderson Loop ramp (0.5 mi)\nMerge onto TX-1604 Loop W (9.2 mi)\nTake the exit toward Voigt Dr/Stone Oak Pkwy (0.2 mi)\nMerge onto N Loop 1604 E (0.3 mi)\nTurn right onto Hardy Oak Blvd (0.2 mi)\nTurn right (230 ft)\nKeep left- Destination will be on the left (79 ft)",
            "em_service_type": "Medical",
            "address_id": 5,
            "address_1": "18600 Hardy Oak Blvd",
            "address_2": null,
            "address_city": "San Antonio",
            "address_state": "TX",
            "address_zip": "78258",
            "job_site_id": null,
            "address_latitude": "29.61348779940569",
            "address_longitude": "-98.47755827236053"
        }
    ]
}

I'm working on an app for a company that needs to find the nearby emergency services in relation to their job sites. The markers would be the emergency service locations.

If I add a static marker to the google map, it displays fine, the dynamic ones do not.

-Twitch

have you tried long/lat only? Not an address but just long/lat?

What's that do?

Pretty sure I did, but I'll try again when I get a chance. I noticed that the address alone doesn't work for sure.

I always use just the long/lat for the marker and then put the address in the info box. Google maps will wants to decode the address to a long/lat and in the past there was a charge on that? So once I had a lot of addresses to add, I ran the addresses through a service that returned the long and lat and then I imported that data.

https://developers.google.com/maps/documentation/geocoding/overview

would need the geocoding API turned on to get straight addresses to work.

1 Like

I removed the address and just used lat and long, still not working.... :disappointed_relieved:

Its an old tutorial/video but may help

Thanks @Hyperbytes , I'll definitely take a look at this, sometime this week. I may do a blank page and get this working and then see where on my development pages it stops working.