Last active
January 5, 2018 22:11
-
-
Save rochoa/7511cf1c58a893badae8 to your computer and use it in GitHub Desktop.
[CARTO] CartoCSS example – polygon-simplify
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CartoDB: CartoCSS example – polygon-simplify</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" /> | |
<style> | |
html, body, #map { | |
height: 100%; | |
padding: 0; | |
margin: 0; | |
} | |
</style> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" /> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script src="http://libs.cartocdn.com/cartodb.js/v3/3.15/cartodb.js"></script> | |
<script> | |
function main() { | |
var map = L.map('map', { | |
zoomControl: false, | |
center: [43, 0], | |
zoom: 3 | |
}) | |
cartodb.createLayer(map, { | |
user_name: 'examples', | |
type: 'cartodb', | |
sublayers: [{ | |
sql: 'select * from country_boundaries', | |
cartocss: '#layer { polygon-fill: #000; polygon-opacity: 1.0; line-width: 0.0; polygon-simplify: 10.0; polygon-simplify-algorithm: zhao-saalfeld; }' | |
}] | |
}) | |
.addTo(map); | |
} | |
window.onload = main; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment