Skip to content

Commit

Permalink
refactor: move css imports and interface defintions to top of maplibr…
Browse files Browse the repository at this point in the history
…e.astro
  • Loading branch information
spwoodcock committed Jan 6, 2025
1 parent 9605d2c commit bb9eca3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/components/map/maplibre.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
import 'maplibre-gl/dist/maplibre-gl.css';
import '@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css';
export interface Props {
latitude: number
longitude: number
Expand All @@ -11,6 +14,14 @@ export interface Props {
draw?: boolean
}
interface NominatimFeature {
bbox: [number, number, number, number];
properties: {
display_name: string;
[key: string]: any;
};
}
const {
latitude,
longitude,
Expand Down Expand Up @@ -66,24 +77,13 @@ const {
</maplibre-astro>

<script>
import 'maplibre-gl/dist/maplibre-gl.css';
import '@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css';

import type { MaplibreGeocoderApi } from '@maplibre/maplibre-gl-geocoder';
import type { StyleSpecification, LngLatLike } from 'maplibre-gl';

import maplibre from 'maplibre-gl';
import MaplibreGeocoder from '@maplibre/maplibre-gl-geocoder';
import { TerraDraw, TerraDrawMapLibreGLAdapter, TerraDrawPolygonMode } from "terra-draw";

interface NominatimFeature {
bbox: [number, number, number, number];
properties: {
display_name: string;
[key: string]: any;
};
}

class MapLibreMap extends HTMLElement {
map: maplibre.Map | null = null;
draw: TerraDraw | null = null;
Expand Down

0 comments on commit bb9eca3

Please sign in to comment.