Reading GeoJSON coordinates into Unity for Interactive 2D Map.
Hello,
My goal is to make an interactive 2D map in Unity where I can click on different countries and they would get highlighted (for example).
I've gathered a data set from Natural Earth and used mapshaper to convert the .shp .dbf and .prj files into a GeoJSON file. My next step was to bring this json file into unity. There is a repository I found that transforms GeoJSON files into a Unity object. I imported it and its prerequisite library.
I've uploaded the GeoJSON file to Google Drive for reference (20 mb).
I've added the following lines of code to import and load it.
public TextAsset GeoJSONFile;
public GeoJSON.FeatureCollection collection;
void Start()
{
collection = GeoJSON.GeoJSONObject.Deserialize(GeoJSONFile.text);
}
Now that the coordinates are loaded, my question is: how would I go about drawing this map using the coordinates given in the GeoJSON file? I'm thinking maybe drawing 2D vectors? I'm not sure what exists in Unity to help me do this. I've tried looking up for tutorial videos and reading forum posts but I couldn't find anything on this.
Your answer
Follow this Question
Related Questions
Single Image Map Pan/Zoom & Coordinates 1 Answer
[SOLVED] Converting a Generic List to JSON in Unity 3 Answers
Refresh Chat room messages 1 Answer
MapNav - Geolocation Toolkit Gives Wrong Long and Lat 0 Answers
Pasting data from JSON into UI 0 Answers