D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
nunojpg
Full window
Github gist
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>
https://maps.googleapis.com/maps/api/js