diff --git a/packages/imagetools/api/utils/getProcessedImage.js b/packages/imagetools/api/utils/getProcessedImage.js index 98eae1d..ff3546f 100644 --- a/packages/imagetools/api/utils/getProcessedImage.js +++ b/packages/imagetools/api/utils/getProcessedImage.js @@ -15,23 +15,19 @@ export default async function getProcessedImage(src, transformConfigs) { throwErrorIfUnsupported(src, extname(src).slice(1)); let base; - if (src.match("(http://|https://|data:image/).*")) { - ({ src, base } = await getResolvedSrc(src)); + ({ src, base } = await getResolvedSrc(src)) } else { const { default: { isSsrBuild }, - } = await import("../../astroViteConfigs.js"); + } = await import("../../astroViteConfigs.js") if (isSsrBuild) { - const filename = fileURLToPath(import.meta.url); - - const assetPath = resolve(filename, "../../client") + src; - + const filename = fileURLToPath(import.meta.url) + const assetPath = resolve(filename, "../../client") + src src = "/" + relative(cwd, assetPath); } } - const { w, h, diff --git a/src/components/polymech/map.astro b/src/components/polymech/map.astro index 1e81031..c04e8f3 100644 --- a/src/components/polymech/map.astro +++ b/src/components/polymech/map.astro @@ -1,5 +1,7 @@ --- -import { Location, Options } from './map-types'; + +import { Location, Options } from './map-types' +import { Img } from "imagetools/components" interface Props { locations?: Location[]; @@ -14,11 +16,13 @@ const { locations = [ { geo: { lat: -2.272012, lon: 40.890586 }, title: 'Shela Beach' + }, + { + geo: { lat: -1.075012, lon: 40.890586 }, + title: 'Shela Beach2' } ], options = {} } = Astro.props; - -const { zoom = 10, api_key = '' } = options; - +const { zoom = 9, api_key = '' } = options; // Generate markers query param const markersParam = locations.map((loc, index) => `markers=color:red%7Clabel:${String.fromCharCode(65 + index)}%7C${loc.geo.lat},${loc.geo.lon}`).join('&'); @@ -26,21 +30,21 @@ const centerLat = locations.reduce((sum, loc) => sum + loc.geo.lat, 0) / locatio const centerLon = locations.reduce((sum, loc) => sum + loc.geo.lon, 0) / locations.length; const googleMapsUrl = api_key ? - `https://maps.googleapis.com/maps/api/staticmap?center=${centerLat},${centerLon}&zoom=${zoom}&size=600x400&${markersParam}&key=${api_key}` : null; + `https://maps.googleapis.com/maps/api/staticmap?center=${centerLat},${centerLon}&size=1200x600&${markersParam}&key=${api_key}` : null; const hasError = !api_key; --- -