Openlayers combat: loading GeoJSON

In the interaction of OPenlayers, we often need to load some data. In this actual combat, the demonstration is to load GeoJSON files.
GeoJSON is a format for encoding geographic data structures using JavaScript Object Notation (JSON). In short, GeoJSON provides you with a simple format to represent simple geographic features along with their non-spatial attributes.

renderings

insert image description here

switzerland.geojson used

{
   
    
    
	"type": "FeatureCollection",
	"features": [
		{
   
    
    
			"type":</

Guess you like

Origin blog.csdn.net/cuclife/article/details/131763114