mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
fix(library): view-bounded GeoJSON draws as the GeoJSON loader drew it
On the draw port, a Data Library dataset's polygon and line edges were drawn as geodesics and every feature took the entry's colour. The loader drew ground edges along rhumb lines and honoured a feature's own simplestyle fill, fill-opacity, stroke, stroke-opacity and stroke-width, with a colorBy fill over them. The library now uses local GeoJSON's rhumb densifying and simplestyle reading for the same result.
This commit is contained in:
1 parent
5f98f8bdf3
commit
667ca632ed
3 files changed
+78
-12
No files matched your search
@@ -344,7 +344,7 @@ const given = (value) => value !== undefined && value !== null;
|
||||
* properties (`stroke`, `stroke-opacity`, `stroke-width`), over the
|
||||
* layer's colour and width.
|
||||
*/
|
||||
function strokeOf(properties, rgba) {
|
||||
export function strokeOf(properties, rgba) {
|
||||
let color = null;
|
||||
let widthPx = FEATURE_LINE_WIDTH_PX;
|
||||
if (properties) {
|
||||
@@ -362,7 +362,7 @@ function strokeOf(properties, rgba) {
|
||||
* A polygon's own fill as the GeoJSON loader read it (`fill` keeps the
|
||||
* layer's fill alpha; `fill-opacity` sets the alpha).
|
||||
*/
|
||||
function fillOf(properties, fillColor) {
|
||||
export function fillOf(properties, fillColor) {
|
||||
let fill = null;
|
||||
if (properties) {
|
||||
if (given(properties.fill)) {
|
||||
@@ -409,7 +409,7 @@ function* markerSymbols(features) {
|
||||
* Ground `coordinates` as `{lon, lat}` degrees along the rhumb lines
|
||||
* between them, as the GeoJSON loader drew its draped edges.
|
||||
*/
|
||||
function rhumbPositions(coordinates) {
|
||||
export function rhumbPositions(coordinates) {
|
||||
return densifyRhumb(
|
||||
coordinates.map((c) => ({ lon: c[0] * RADIANS, lat: c[1] * RADIANS })),
|
||||
RHUMB_GRANULARITY_M,
|
||||
|
||||
Reference in new issue
Block a user