@foodmarketmaker/mapag 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { NgZone, AfterViewInit, OnDestroy, ElementRef, OnInit } from '@angular/core';
3
- import { Map as Map$1, SourceSpecification, LayerSpecification, StyleSpecification, GeoJSONFeature, MapMouseEvent, PointLike, MapTouchEvent, MapGeoJSONFeature, Popup, SymbolLayerSpecification, FillLayerSpecification, LineLayerSpecification, CircleLayerSpecification } from 'maplibre-gl';
3
+ import { StyleSpecification, Map as Map$1, SourceSpecification, LayerSpecification, GeoJSONFeature, MapMouseEvent, PointLike, MapTouchEvent, MapGeoJSONFeature, Popup, SymbolLayerSpecification, FillLayerSpecification, LineLayerSpecification, CircleLayerSpecification } from 'maplibre-gl';
4
4
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
5
5
  import * as rxjs from 'rxjs';
6
6
  import { Subject, Subscription } from 'rxjs';
@@ -18,6 +18,7 @@ interface StyleData {
18
18
  nameColor?: string;
19
19
  sources?: string[];
20
20
  layers?: string[];
21
+ postFetch?: (styleJson: StyleSpecification) => void;
21
22
  }
22
23
  interface CustomImage {
23
24
  data: any;
@@ -33,6 +34,7 @@ interface CustomSourcesAndLayersData {
33
34
  [key: string]: CustomImage;
34
35
  };
35
36
  }
37
+ declare const DEFAULT_GLYPHS = "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/{fontstack}/{range}.pbf";
36
38
  declare class Styles {
37
39
  style: _angular_core.WritableSignal<StyleData>;
38
40
  map: Map$1 | undefined;
@@ -463,6 +465,7 @@ interface MapAreaSelection {
463
465
  }
464
466
  declare function discoverLayers(pmtilesUrl: string): Promise<string[]>;
465
467
  declare function sampleTilesForLayers(pmtiles: PMTiles): Promise<string[]>;
468
+ declare function pmtilesPixelInfo(url: string, map: Map$1, e: MapMouseEvent): Promise<Uint8ClampedArray | undefined>;
466
469
 
467
470
  declare class HighlightMapper implements MapboxMapper {
468
471
  count: number;
@@ -609,6 +612,61 @@ interface CensusTract {
609
612
  GeoID: string;
610
613
  }
611
614
 
615
+ declare class CroplandDataLayerMapper implements MapboxMapper {
616
+ static PMTILES: string;
617
+ LAYER_ID: string;
618
+ SOURCE_ID: string;
619
+ settings: _angular_core.WritableSignal<CroplandDataLayerSettings>;
620
+ current: Popup | null;
621
+ currentFeatureID: string | number | undefined;
622
+ over: _angular_core.WritableSignal<geojson.Feature<geojson.Geometry, geojson.GeoJsonProperties> | null>;
623
+ legends?: LegendDesc[] | undefined;
624
+ count: number;
625
+ total: number;
626
+ map: Map$1 | undefined;
627
+ popup: Popup | null;
628
+ constructor(settings?: Partial<CroplandDataLayerSettings>);
629
+ update(settings: Partial<CroplandDataLayerSettings>): void;
630
+ private _update;
631
+ private create;
632
+ onReady(map: Map$1, svc: MapService): Promise<void>;
633
+ reset(): void;
634
+ clear(): void;
635
+ pixelToCropType(pixel: Uint8ClampedArray): CroplandType | undefined;
636
+ toLegend(): LegendDesc;
637
+ }
638
+ declare class CroplandDataLayerSettings {
639
+ visible: boolean;
640
+ }
641
+ type CroplandType = {
642
+ code: number;
643
+ class: string;
644
+ color: string;
645
+ };
646
+ declare const CroplandLegend: CroplandType[];
647
+
648
+ declare class EsriMapper implements MapboxMapper {
649
+ jsonUrl: string;
650
+ SOURCE_ID: string;
651
+ map: Map$1 | undefined;
652
+ legends?: LegendDesc[] | undefined;
653
+ count: number;
654
+ total: number;
655
+ current: string[];
656
+ settings: _angular_core.WritableSignal<EsriSettings>;
657
+ constructor(settings?: Partial<EsriSettings>);
658
+ makeSettings(): Promise<EsriSettings>;
659
+ update(settings: Partial<EsriSettings>): void;
660
+ _update(settings: EsriSettings): void;
661
+ onReady(map: Map$1, svc: MapService): void;
662
+ clear(): void;
663
+ reset(): void;
664
+ }
665
+ declare class EsriSettings {
666
+ options: LayerSpecification[];
667
+ layers: Map<string, LayerSpecification>;
668
+ }
669
+
612
670
  declare class LayerSettings {
613
671
  visible: boolean;
614
672
  }
@@ -676,6 +734,53 @@ declare class HardinessSettings extends PolygonLayerSettings {
676
734
  borderOpacity: number;
677
735
  }
678
736
 
737
+ declare class NAASMapper implements MapboxMapper {
738
+ LAYER_ID: string;
739
+ SOURCE_ID: string;
740
+ settings: _angular_core.WritableSignal<NAASSettings>;
741
+ current: Popup | null;
742
+ currentFeatureID: string | number | undefined;
743
+ over: _angular_core.WritableSignal<geojson.Feature<geojson.Geometry, geojson.GeoJsonProperties> | null>;
744
+ map: Map$1 | undefined;
745
+ legends?: LegendDesc[] | undefined;
746
+ count: number;
747
+ total: number;
748
+ constructor(settings?: Partial<NAASSettings>);
749
+ update(settings: Partial<NAASSettings>): void;
750
+ private _update;
751
+ private create;
752
+ onReady(map: Map$1, svc: MapService): void;
753
+ reset(): void;
754
+ clear(): void;
755
+ }
756
+ declare class NAASSettings {
757
+ url: string;
758
+ visible: boolean;
759
+ fillColor: string;
760
+ fillOpacity: number;
761
+ borderColor: string;
762
+ borderWidth: number;
763
+ borderOpacity: number;
764
+ labelsVisible: boolean;
765
+ labelsSize: number;
766
+ labelsColor: string;
767
+ labelsHaloColor: string;
768
+ labelsHaloWidth: number;
769
+ labelsOpacity: number;
770
+ labelOverlap: boolean;
771
+ autoSelectLayer: boolean;
772
+ }
773
+
774
+ declare class SimpleMapper implements MapboxMapper {
775
+ reset(): void;
776
+ clear(): void;
777
+ legends?: LegendDesc[] | undefined;
778
+ count: number;
779
+ total: number;
780
+ map: Map$1 | undefined;
781
+ onReady(map: Map$1, svc: MapService): void;
782
+ }
783
+
679
784
  declare class StandardLayersMapper implements MapboxMapper {
680
785
  static readonly EMPTY_SOURCE = "empty";
681
786
  static readonly POLYGONS_BACKGROUND = "polygons-background";
@@ -786,5 +891,5 @@ declare class HttpBoundaryLoader implements Geoloader {
786
891
  loadGeoJson(url: string, geofield: string): Promise<MultiPolygon | undefined>;
787
892
  }
788
893
 
789
- export { AddLayer, AddSource, AreaMapperMapper, BackgroundMaskMapper, BaseMapLight, BasemapSelect, BasemapSelectMenu, CensusTractMapper, DrawingMapper, HardinessMapper, HardinessSettings, HttpBoundaryLoader, MapAreaSelectComponent, MapComponent, MapSelectionService, MapService, MapStyles, MapboxMapperGroup, NoOpMapper, RemoveLayer, RemoveSource, SaveMap, SelectMode, StandardLayersMapper, Styles, VectorTileServerMapper, WatershedMapper, WatershedSettings, discoverLayers, isGeoloader, isMultiPolygon, isNumber2DArray, isNumber3DArray, isPolygon, mapboxLoadImages, mapboxloadImage, sampleTilesForLayers, simpleClone, toMultiPolygon, trySync };
790
- export type { AreaSelectionType, CensusTract, CustomImage, CustomSourcesAndLayersData, DataCustomization, Geoloader, HydrologicUnit, IMapboxSettings, LegendDesc, LegendItem, MapAreaSelectMode, MapAreaSelection, MapboxImage, MapboxLayerType, MapboxMapper, MapboxStyler, PointData, PointDataLoader, PointDataOptions, PopupRenderer, StyleData, VectorTileServerSource };
894
+ export { AddLayer, AddSource, AreaMapperMapper, BackgroundMaskMapper, BaseMapLight, BasemapSelect, BasemapSelectMenu, CensusTractMapper, CroplandDataLayerMapper, CroplandDataLayerSettings, CroplandLegend, DEFAULT_GLYPHS, DrawingMapper, EsriMapper, EsriSettings, HardinessMapper, HardinessSettings, HttpBoundaryLoader, MapAreaSelectComponent, MapComponent, MapSelectionService, MapService, MapStyles, MapboxMapperGroup, NAASMapper, NAASSettings, NoOpMapper, RemoveLayer, RemoveSource, SaveMap, SelectMode, SimpleMapper, StandardLayersMapper, Styles, VectorTileServerMapper, WatershedMapper, WatershedSettings, discoverLayers, isGeoloader, isMultiPolygon, isNumber2DArray, isNumber3DArray, isPolygon, mapboxLoadImages, mapboxloadImage, pmtilesPixelInfo, sampleTilesForLayers, simpleClone, toMultiPolygon, trySync };
895
+ export type { AreaSelectionType, CensusTract, CroplandType, CustomImage, CustomSourcesAndLayersData, DataCustomization, Geoloader, HydrologicUnit, IMapboxSettings, LegendDesc, LegendItem, MapAreaSelectMode, MapAreaSelection, MapboxImage, MapboxLayerType, MapboxMapper, MapboxStyler, PointData, PointDataLoader, PointDataOptions, PopupRenderer, StyleData, VectorTileServerSource };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foodmarketmaker/mapag",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Angular library for interactive maps with advanced geospatial features",
5
5
  "author": "Food Market Maker",
6
6
  "license": "MIT",