I wanted to create a function inside a different JS file called "MapMarkers.js", and then call that function to main JS file called "mapping.js". Importing the function to the main JS file seems like it working correctly. It's just seems like the "mapMarkers" property from the isn't reading the data?
If helpful here's the Map documentation:
https://developer.salesforce.com/docs/component-library/bundle/lightning-map/documentation
mapMarkers.js Code
export function MapMarkers(SearchCity, SearchState, SearchStreet){
[
{
location: {
City: SearchCity,
Country: 'USA',
State: SearchState,
Street: SearchStreet,
// PostalCode: ,
},
value: 'location001',
title: 'Headquarters',
description: 'Headquarters',
// fillColor: '#CF3476',
},
{
location: {
City: 'Boston',
Country: 'USA',
State: 'MA',
},
value: 'MA_HQ',
title: 'MA Headquarters',
},
];
}
mapping.js Code
mapMarkers = MapMarkers(SearchCity, SearchState, SearchStreet);