Skip to content

Instantly share code, notes, and snippets.

@nunojpg
Last active July 11, 2017 17:20
Show Gist options
  • Save nunojpg/691a7d4857ed6dadd54e152ced0cf37e to your computer and use it in GitHub Desktop.
Save nunojpg/691a7d4857ed6dadd54e152ced0cf37e to your computer and use it in GitHub Desktop.
RFC 7946 3.1.6. Polygon right-hand rule
<!DOCTYPE html>
<html>
<head>
<title>RFC 7946 3.1.6. Polygon right-hand rule</title>
<script src="//maps.googleapis.com/maps/api/js"></script>
<style type="text/css">
html,
body {
margin: 0px;
padding: 0px;
}
html,
body,
#map {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
let map = new google.maps.Map(document.getElementById('map'), {
zoom: 2,
mapTypeId: google.maps.MapTypeId.TERRAIN,
center: new google.maps.LatLng(0, 0),
});
box = function (maxlon, maxlat) {
return {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-maxlon,
0
],
[
maxlon,
0
],
[
maxlon,
maxlat
],
[
-maxlon,
maxlat
],
[
-maxlon,
0
]
]
]
},
"properties": {
"name": "name"
}
}
]
}
}
map.data.addGeoJson(box(30,85))
map.data.addGeoJson(box(91,85))
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment