Mapkit Mrkers Error

I have been working on the mapkit tutorial. Since that, I have been modifying it for my use.
When I add more than 10 markers I get the error message.

“Trailing closure passed to parameter of type ‘Binding<MapFeature?>’ that does not accept a closure”

Is there a limit on how many markers can be used?


How are you specifying the Map Markers?

I assume that you are specifying each location explicitly on the Map in which case if you had more than 10 entries inside of a View you will get an error.

If you were to place all your locations in an array then you could loop through them and that would allow you to place any number of Markers on the Map.

Can you share the code that attempts to place the Markers on the Map?

Thank you. I was wondering about putting them in an array or similar. Yes, I can share my code. Do I post it in a message? Many thanks for your help. Very much appreciated

The simplest way is to compress your project into a zip file and upload to either DropBox or Google Drive and create a share link there and post that in a reply.

To compress the project, locate the project folder in Finder and then right click on the top level folder and select Compress ProjectName. The top level folder is the one that contains the file named ProjectName.xcodeproj and the folder named ProjectName.

Upload that zip file to either Dropbox or Google Drive and then create a share link then copy that link and paste that in a reply to this thread.

If you choose to use Google Drive then when you create the Share link, ensure that the “General Access” option is set to “Anyone with the Link” rather than “Restricted”.

You can either post the link in a reply here, or if you prefer, direct message me and share the link there.