Skip to content
Open
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
12 changes: 8 additions & 4 deletions packages/catalog-realm/components/map-render.gts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export class MapRender extends GlimmerComponent<MapRenderSignature> {
margin: 0;
width: 100%;
height: 100%;
min-height: 300px;
position: relative;
display: flex;
align-items: center;
Expand Down Expand Up @@ -198,7 +197,10 @@ class LeafletLayerState implements LeafletLayerStateInterface {
const color =
i === 0 ? '#22c55e' : i === coords.length - 1 ? '#ef4444' : '#3b82f6';
const marker = createMarker(c, color);
if (c.address) marker.bindPopup(c.address);
const trimmedAddress = c.address?.trim() || undefined;
const popupContent =
trimmedAddress ?? `${c.lat.toFixed(6)}, ${c.lng.toFixed(6)}`;
marker.bindPopup(popupContent);
return marker;
});
}
Expand Down Expand Up @@ -247,7 +249,7 @@ class LeafletLayerState implements LeafletLayerStateInterface {

if (coords.length === 1) {
// single point → just flyTo
this.map.flyTo([coords[0].lat, coords[0].lng], 15, {
this.map.flyTo([coords[0].lat, coords[0].lng], 13, {
animate: true,
duration: 1.2,
});
Expand Down Expand Up @@ -348,7 +350,9 @@ export default class LeafletModifier extends Modifier<LeafletModifierSignature>
) {
if (!this.element) return;

this.map = L.map(this.element).setView([0, 0], 13);
const center = [20, 0];
const zoom = 2;
this.map = L.map(this.element).setView(center, zoom);

L.tileLayer(
mapConfig?.tileserverUrl ||
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"data": {
"meta": {
"adoptsFrom": {
"name": "GeoPointFieldSpec",
"module": "../geo-point-spec"
}
},
"type": "card",
"attributes": {
"ref": {
"name": "default",
"module": "../../fields/geo-point"
},
"basic": {
"lat": 40.7127281,
"lon": -74.0060152
},
"readMe": null,
"cardInfo": {
"name": null,
"notes": null,
"summary": null,
"cardThumbnailURL": null
},
"combined": {
"lat": 51.5074456,
"lon": -0.1277653
},
"specType": "field",
"cardTitle": "Geo Point Field",
"mapPicker": {
"lat": 54.51384095408507,
"lon": 30.44159057801324
},
"cardDescription": "Spec card that renders GeoPointField examples.",
"containedExamples": [],
"withQuickLocations": {
"lat": 40.7127281,
"lon": -74.0060152
},
"mapPickerWithAddons": {
"lat": 44.83685807826857,
"lon": 11.61730322820671
},
"withCurrentLocation": {
"lat": 3.1685246346835263,
"lon": 101.53336335143155
},
"mapPickerWithQuickLocations": {
"lat": 51.5074456,
"lon": -0.1277653
},
"mapPickerWithCurrentLocation": {
"lat": 3.1685528122228006,
"lon": 101.53336585084402
}
},
"relationships": {
"cardInfo.theme": {
"links": {
"self": null
}
},
"linkedExamples": {
"links": {
"self": null
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"data": {
"meta": {
"adoptsFrom": {
"name": "GeoSearchPointFieldSpec",
"module": "../geo-search-point-spec"
}
},
"type": "card",
"attributes": {
"ref": {
"name": "default",
"module": "../../fields/geo-search-point"
},
"basic": {
"lat": 3.1336269,
"lon": 101.6299203,
"searchKey": "Glo damansara"
},
"readMe": null,
"cardInfo": {
"name": null,
"notes": null,
"summary": null,
"cardThumbnailURL": null
},
"combined": {
"lat": 3.1516964,
"lon": 101.6942371,
"searchKey": "Kuala Lumpur, 50100, Malaysia"
},
"specType": "field",
"cardTitle": "Geo Search Point Field",
"withTopResults": {
"lat": 3.1414907,
"lon": 101.7182597,
"searchKey": "Tun Razak Exchange (TRX), Pudu, Kuala Lumpur, 55188, Malaysia"
},
"cardDescription": "Spec card that renders GeoSearchPointField examples.",
"containedExamples": [],
"withoutRecentSearches": {
"lat": 48.8534951,
"lon": 2.3483915,
"searchKey": "Paris, Ile-de-France, Metropolitan France, France"
}
},
"relationships": {
"cardInfo.theme": {
"links": {
"self": null
}
},
"linkedExamples": {
"links": {
"self": null
}
}
}
}
}
Loading
Loading