-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Add support for GeoJSON #116
Closes #116
- Loading branch information
1 parent
8497add
commit 441c123
Showing
20 changed files
with
524 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Serbia" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [20.906982421875, 44.36313311380771] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Austria" | ||
}, | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[13.5791015625, 47.45037978769006], | ||
[13.743896484375, 46.31658418182218], | ||
[15.875244140625, 46.79253827035982], | ||
[17.1826171875, 48.151428143221224], | ||
[16.677246093749996, 48.828565527993234], | ||
[13.5791015625, 47.45037978769006] | ||
] | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Bulgaria" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [25.1806640625, 42.97250158602597] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Romania" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [24.949951171875, 45.920587344733654] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Greece" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [22.8955078125, 38.71980474264237] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Switzerland" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [8.1298828125, 47.12995075666307] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Hungary" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [19.51171875, 47.42808726171425] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"country": "Poland" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [19.423828125, 52.29504228453735] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>GeoJSON Example</title> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/dist/leaflet.css" | ||
integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ==" | ||
crossorigin="" | ||
/> | ||
<!-- theme can be easily customized via css --> | ||
<link href="../src/css/netjsongraph-theme.css" rel="stylesheet" /> | ||
<link href="../src/css/netjsongraph.css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<script type="text/javascript" src="../dist/netjsongraph.min.js"></script> | ||
<script type="text/javascript"> | ||
const map = new NetJSONGraph("./data/geojson-sample.json", { | ||
render: "map", | ||
// set map initial state. | ||
mapOptions: { | ||
center: [46.86764405052012, 19.675998687744144], | ||
zoom: 5, | ||
}, | ||
}); | ||
|
||
map.render(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
outline: none; | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
width: 100%; | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
outline: none; | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
width: 100%; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.