iosswiftsprite-kitcore-graphicsmetal

Effective MacOS/iOS framework for rendering custom maps (Spritekit or raw Metal)?


trying to keep this question as specific as I can to avoid being closed as too broad. My end goal is to render marine (as in nautical) maps. See image below as a reference. I've researched some of the various Apple frameworks to see what suits this best. My data input is effectively an array of arrays where each child array represents a cartographic feature (think an island or boat dock). I started w/ Core Graphics as it has a very simple API however it's performance is poor (it was taking > 100ms for a single layer of data when I can expect 10-20 layers on average).

Which brings me to my question: would SpriteKit be an effective framework for handling this workload? My preference is to avoid learning Metal but if fellow devs recommend this approach I will invest the time. SpriteKit seems to be able to handle this- I'll probably be working with a few thousand to a few hundred thousand points/vertices at a time. I dont need any complex animations as the map is static in terms of display. Any inputs appreciated!

enter image description here


Solution

  • GeoJSONMap

    Build maps from GeoJSON with MapKit or SpriteKit.

    SpriteKit maps can be displayed offline and/or as planes in ARKit.

    I loaded a city map resulting in 256 static SpriteKit nodes made from filled GeoJSON polygons, it gives me only 3.7 FPS on iPhone XS. Perhaps some optimisation is possible, but I did not try.