Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/map-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
},
"dependencies": {
"@macrostrat/color-utils": "workspace:*",
"@macrostrat/ui-components": "workspace:*",
"@types/d3-selection": "^3.0.11",
"axios": "^1.7.9",
"d3-selection": "^3.0.0",
"mapbox-gl": "^2.15.0||^3.0.0",
"textures": "^1.2.3"
}
Expand Down
5 changes: 3 additions & 2 deletions packages/map-styles/src/layer-helpers/pattern-fill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export function createSolidColorImage(imgColor) {
return ctx.getImageData(0, 0, 40, 40);
}

export async function createUnitFill(spec: PatternFillSpec): Promise<ImageData> {
export async function createUnitFill(
spec: PatternFillSpec,
): Promise<ImageData> {
/** Create a fill image for a map unit. */
if (spec.patternURL != null) {
const img = await loadImage(spec.patternURL);
Expand All @@ -71,4 +73,3 @@ export async function createUnitFill(spec: PatternFillSpec): Promise<ImageData>
return createSolidColorImage(spec.color);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export async function mapLoadImage(map, url: string) {
return new Promise((resolve, reject) => {
map.loadImage(url, function(err, image) {
map.loadImage(url, function (err, image) {
// Throw an error if something went wrong
if (err) {
console.error(`Could not load image ${url}`);
Expand All @@ -24,4 +24,3 @@ export function createTransparentImage() {
ctx.fillRect(0, 0, 40, 40);
return ctx.getImageData(0, 0, 40, 40);
}

2 changes: 1 addition & 1 deletion packages/static-map-utils/src/map-scale/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hyper from "@macrostrat/hyper";
import { scaleLinear } from "@visx/scale";
import styles from "./index.module.sass";
import { useCallback, useState } from "react";
import { useCallback, useState } from "react";
import classNames from "classnames";

const h = hyper.styled(styles);
Expand Down
5 changes: 4 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,10 @@ __metadata:
resolution: "@macrostrat/map-styles@workspace:packages/map-styles"
dependencies:
"@macrostrat/color-utils": "workspace:*"
"@macrostrat/ui-components": "workspace:*"
"@types/d3-selection": "npm:^3.0.11"
axios: "npm:^1.7.9"
d3-selection: "npm:^3.0.0"
mapbox-gl: "npm:^2.15.0||^3.0.0"
parcel: "npm:^2.16.0"
textures: "npm:^1.2.3"
Expand Down Expand Up @@ -2668,7 +2671,7 @@ __metadata:
languageName: unknown
linkType: soft

"@macrostrat/ui-components@workspace:^, @macrostrat/ui-components@workspace:packages/ui-components":
"@macrostrat/ui-components@workspace:*, @macrostrat/ui-components@workspace:^, @macrostrat/ui-components@workspace:packages/ui-components":
version: 0.0.0-use.local
resolution: "@macrostrat/ui-components@workspace:packages/ui-components"
dependencies:
Expand Down