@page-speed/maps 0.1.3 → 0.1.5
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/README.md +120 -0
- package/dist/components/geo-map.cjs +1228 -0
- package/dist/components/geo-map.cjs.map +1 -0
- package/dist/components/geo-map.d.cts +138 -0
- package/dist/components/geo-map.d.ts +138 -0
- package/dist/components/geo-map.js +1207 -0
- package/dist/components/geo-map.js.map +1 -0
- package/dist/components/index.cjs +1350 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +5 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +1326 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/map-marker.cjs +137 -0
- package/dist/components/map-marker.cjs.map +1 -0
- package/dist/components/map-marker.d.cts +76 -0
- package/dist/components/map-marker.d.ts +76 -0
- package/dist/components/map-marker.js +130 -0
- package/dist/components/map-marker.js.map +1 -0
- package/dist/core/MapLibre.cjs +46 -20
- package/dist/core/MapLibre.cjs.map +1 -1
- package/dist/core/MapLibre.js +46 -20
- package/dist/core/MapLibre.js.map +1 -1
- package/dist/core/index.cjs +46 -20
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +46 -20
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +964 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +945 -39
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/utils/cn.cjs +13 -0
- package/dist/utils/cn.cjs.map +1 -0
- package/dist/utils/cn.d.cts +16 -0
- package/dist/utils/cn.d.ts +16 -0
- package/dist/utils/cn.js +11 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/index.cjs +63 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +4 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +42 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/simple-pressable.cjs +63 -0
- package/dist/utils/simple-pressable.cjs.map +1 -0
- package/dist/utils/simple-pressable.d.cts +20 -0
- package/dist/utils/simple-pressable.d.ts +20 -0
- package/dist/utils/simple-pressable.js +41 -0
- package/dist/utils/simple-pressable.js.map +1 -0
- package/package.json +29 -2
package/README.md
CHANGED
|
@@ -570,3 +570,123 @@ function GeoMap({ markers, clusters, defaultViewState }) {
|
|
|
570
570
|
## License
|
|
571
571
|
|
|
572
572
|
BSD-3-Clause. See [LICENSE](./LICENSE) for details.
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## New: Feature-Rich Components
|
|
577
|
+
|
|
578
|
+
### `GeoMap`
|
|
579
|
+
|
|
580
|
+
Full-featured map component with markers, clusters, rich media panels, and automatic view calculation.
|
|
581
|
+
|
|
582
|
+
```tsx
|
|
583
|
+
import { GeoMap, createMapMarkerElement } from "@page-speed/maps";
|
|
584
|
+
import type { GeoMapMarker } from "@page-speed/maps";
|
|
585
|
+
|
|
586
|
+
const markers: GeoMapMarker[] = [
|
|
587
|
+
{
|
|
588
|
+
id: 'office',
|
|
589
|
+
latitude: 40.7128,
|
|
590
|
+
longitude: -74.0060,
|
|
591
|
+
title: 'New York Office',
|
|
592
|
+
summary: 'Our headquarters in downtown Manhattan',
|
|
593
|
+
locationLine: '123 Broadway, New York, NY 10001',
|
|
594
|
+
hoursLine: 'Mon-Fri: 9:00 AM - 6:00 PM',
|
|
595
|
+
mediaItems: [
|
|
596
|
+
{ id: '1', src: '/office.jpg', alt: 'Office' },
|
|
597
|
+
],
|
|
598
|
+
markerElement: createMapMarkerElement({ size: 'lg' }),
|
|
599
|
+
actions: [
|
|
600
|
+
{
|
|
601
|
+
label: 'Get Directions',
|
|
602
|
+
href: 'https://maps.app.goo.gl/example',
|
|
603
|
+
},
|
|
604
|
+
],
|
|
605
|
+
},
|
|
606
|
+
];
|
|
607
|
+
|
|
608
|
+
<GeoMap
|
|
609
|
+
markers={markers}
|
|
610
|
+
stadiaApiKey="your-key"
|
|
611
|
+
panelPosition="bottom-left"
|
|
612
|
+
showNavigationControl
|
|
613
|
+
/>
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**Key Features:**
|
|
617
|
+
- ✅ Auto-calculated center and zoom from markers
|
|
618
|
+
- ✅ Rich media carousels (images/videos)
|
|
619
|
+
- ✅ Interactive marker panels
|
|
620
|
+
- ✅ Clustering support
|
|
621
|
+
- ✅ Custom marker elements
|
|
622
|
+
- ✅ Action buttons and links
|
|
623
|
+
|
|
624
|
+
[→ Full GeoMap Documentation](./docs/EXAMPLES.md#markers-with-rich-panels)
|
|
625
|
+
|
|
626
|
+
### `MapMarker`
|
|
627
|
+
|
|
628
|
+
Beautiful concentric circle markers with hover and selection states.
|
|
629
|
+
|
|
630
|
+
```tsx
|
|
631
|
+
import { MapMarker, NeutralMapMarker, createMapMarkerElement } from "@page-speed/maps";
|
|
632
|
+
|
|
633
|
+
// Direct usage
|
|
634
|
+
<MapMarker
|
|
635
|
+
size="lg"
|
|
636
|
+
isSelected
|
|
637
|
+
dotColor="#1E40AF"
|
|
638
|
+
innerRingColor="#3B82F6"
|
|
639
|
+
middleRingColor="#93C5FD"
|
|
640
|
+
outerRingColor="#DBEAFE"
|
|
641
|
+
/>
|
|
642
|
+
|
|
643
|
+
// With GeoMap
|
|
644
|
+
const markers = [{
|
|
645
|
+
id: 'loc-1',
|
|
646
|
+
latitude: 40.7128,
|
|
647
|
+
longitude: -74.0060,
|
|
648
|
+
markerElement: createMapMarkerElement({ size: 'lg' }),
|
|
649
|
+
}];
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
**Sizes:** `sm` | `md` | `lg`
|
|
653
|
+
**Pre-configured:** `NeutralMapMarker` for neutral gray design
|
|
654
|
+
|
|
655
|
+
[→ MapMarker Examples](./docs/EXAMPLES.md#custom-marker-elements)
|
|
656
|
+
|
|
657
|
+
---
|
|
658
|
+
|
|
659
|
+
## Migration from @opensite/ui
|
|
660
|
+
|
|
661
|
+
If you're migrating map components from `@opensite/ui` to `@page-speed/maps`, see our comprehensive migration guide:
|
|
662
|
+
|
|
663
|
+
**[→ Migration Guide](./docs/MIGRATION_GUIDE.md)**
|
|
664
|
+
|
|
665
|
+
**Key Changes:**
|
|
666
|
+
- ✅ Fixed zoom/centering bugs
|
|
667
|
+
- ✅ New MapMarker components
|
|
668
|
+
- ✅ Better tree-shakability
|
|
669
|
+
- ✅ Optional peer dependencies for icons/images
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
673
|
+
## Documentation
|
|
674
|
+
|
|
675
|
+
- **[Examples](./docs/EXAMPLES.md)** - Complete code examples
|
|
676
|
+
- **[Migration Guide](./docs/MIGRATION_GUIDE.md)** - Migrating from @opensite/ui
|
|
677
|
+
- **[API Reference](./docs/API.md)** - Full API documentation
|
|
678
|
+
- **[Ecosystem Guidelines](./docs/ECOSYSTEM_GUIDELINES.md)** - Performance standards
|
|
679
|
+
|
|
680
|
+
---
|
|
681
|
+
|
|
682
|
+
## Related Packages
|
|
683
|
+
|
|
684
|
+
- [@page-speed/img](https://www.npmjs.com/package/@page-speed/img) - Optimized image component
|
|
685
|
+
- [@page-speed/video](https://www.npmjs.com/package/@opensite/video) - Performance video component
|
|
686
|
+
- [@page-speed/icon](https://www.npmjs.com/package/@page-speed/icon) - Icon system
|
|
687
|
+
- [@page-speed/forms](https://www.npmjs.com/package/@page-speed/forms) - Form components
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
Made with ❤️ for the DashTrack Platform
|
|
692
|
+
|