Hi community,
I am facing a strange issue … on web & android all markers are shown on the map.
On iOS it doesn’t work as it should.
I have two arrays, a hardcoded version (that works) and an array that will be created through a http request.
const markersHardCoded = [
{
coordinate: { lat: 52.55171, lng: 13.41347 },
title: "Alnatura Super Natur Markt",
address: "Schönhauser Allee 108",
iconUrl: "resources/bio.png",
iconSize: { width: 50, height: 50 },
userid: "13",
login: "14000",
tel: "",
mail: "",
website: "www.alnatura.de",
city: "Berlin",
postalCode: "10439",
text: "",
type: "2",
category: "0",
},
{
coordinate: { lat: 52.509274, lng: 13.304722 },
title: "Alnatura Super Natur Markt",
address: "Wilmersdorfer Straße 46",
iconUrl: "resources/bio.png",
iconSize: { width: 50, height: 50 },
userid: "14",
login: "15000",
tel: "",
mail: "",
website: "www.alnatura.de",
city: "Berlin",
postalCode: "10627",
text: "",
type: "2",
category: "0",
}]
and the other array:
const addSomeMarkers = async (newMap: GoogleMap) => {
markerIds?.value && newMap.removeMarkers(markerIds?.value as string[]);
let markers = props.markerData.map(
({
coordinate,
title,
address,
iconUrl,
opacity,
iconSize,
userid,
login,
tel,
mail,
website,
city,
postalCode,
text,
type,
category,
}) => {
return {
coordinate,
title,
address,
iconUrl,
opacity,
iconSize,
userid,
login,
tel,
mail,
website,
city,
postalCode,
text,
type,
category,
};
}
);
const markerId = await newMap.addMarkers(markers);
the hardcoded version is working, the other doesn’t.
I did console.log of both arrays and compared the strings. There is no difference.
console.log(markersHardCoded.toString() === markers.toString()) ; //true
No warnings, errors in the XCode console …
If someone has any idea, it would be fantastic