I'm using react-google-maps for my app. The map and markers work when running locally. However in my deployed version on Vercel, the map is there- but not the markers. The way I'm defining the markers is through a mapping similar to:
{propertyLocalTest.map((property)=>(
<Marker
key = {property.slug}
icon = {icon}
position={{
lat: parseFloat(property.fields.latitude),
lng: parseFloat(property.fields.longitude)
}}
/>
))}
In another project I noticed img attributes I had given opacities of 60%, being constantly set to opacity 1% when deployed; this was an easy fix- changing % to decimals. I'm thinking something similar is occurring as an individual hardcoded marker (with Lat and Lng) will show up, but when an array of hardcoded lat and lngs is mapped to a Marker
element these will only show up locally, and never when deployed.
I don't have the luxury of inspecting the individual markers within a google map to confirm if this is in-fact the problem. Are there any recommendations on how to diagnose/solve the problem?
In summary: All functionality will work as expected when running locally, but only individual markers that are not mapped will appear when the app is hosted.
My question: Are there any obvious discrepancies between deployed react apps and apps running locally?