Last active
January 21, 2019 08:05
-
-
Save zoutepopcorn/f562669b3c8af032446920ab6ccdccb9 to your computer and use it in GitHub Desktop.
clean circle
This file contains hidden or 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
map.addSource("mysource", mySource) | |
map.addLayer({ | |
"id": "hunter-circle", | |
"type": "circle", | |
"source": "mysource", | |
"paint": { | |
"circle-opacity": ['get', 'opacity'], | |
"circle-stroke-color": ['get', 'stroke'], | |
"circle-color": ['get', 'color'], | |
"circle-radius": ["interpolate", ["exponential", 2.0], ["zoom"], 0.0, 0.0, 20.0, ["get", "stopper"]] | |
}, | |
"filter": ["==", "group", "inner"], | |
}); |
This file contains hidden or 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
const metersToPixelsAtMaxZoom = (meters, latitude) => meters / 0.075 / Math.cos(latitude * Math.PI / 180) | |
let mySource = { | |
"type": "geojson", | |
"data": { | |
"type": "FeatureCollection", | |
"features": [{ | |
"type": "Feature", | |
'properties': { | |
'color': "#f00", | |
'stroke': "#fff", | |
'group': 'inner', | |
'test' : 100, | |
'opacity': 0.5, | |
'stopper' : metersToPixelsAtMaxZoom( 10, 52) | |
}, | |
"geometry": { | |
"type": "Point", | |
"coordinates": [5,52] | |
} | |
}] | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment