ICT:FinalConfig-Place-workdocument
Appearance
PLACE Entity – Dashboard, Form, Coordinates & Map Preview
Work document for building the PLACE dashboard with optional address → coordinates lookup and map preview.
This page describes the steps to create:
- A Cargo table for PLACE entities
- A Template:Place that stores data and shows a map
- A PageForms form that allows
- optional address input
- automatic coordinate lookup
- manual coordinate override
- A Dashboard:Place page listing all places
Everything works without JavaScript and without interfering with Vector‑2022.
1. Cargo Table
Create page: Template:PlaceCargo
{{#cargo_declare:
table=Place;
fields=
Name=String,
Address=String,
Latitude=Float,
Longitude=Float
}}
This defines the storage for PLACE entities.
2. Template:Place
Create page: Template:Place
{{PlaceCargo
|Name={{{Name|}}}
|Address={{{Address|}}}
|Latitude={{{Latitude|}}}
|Longitude={{{Longitude|}}}
}}
;Name: {{{Name}}}
;Address: {{{Address}}}
;Coordinates: {{{Latitude}}}, {{{Longitude}}}
== Map ==
[[File:{{#urlencode:https://staticmap.openstreetmap.de/staticmap.php?center={{{Latitude}}},{{{Longitude}}}&zoom=15&size=400x300&markers={{{Latitude}}},{{{Longitude}}},red-pushpin}}|400px]]
[https://www.openstreetmap.org/?mlat={{{Latitude}}}&mlon={{{Longitude}}}&zoom=16 View on OpenStreetMap]
This template:
- Stores the data in Cargo
- Shows a static map preview
- Provides a link to zoom on OpenStreetMap
3. PageForms Form
Create page: Form:Place
{{{for template|Place}}}
== Basic Information ==
{{{field|Name}}}
== Address (optional) ==
{{{field|Address
|input type=text
|autocomplete on external data
|external data URL=https://nominatim.openstreetmap.org/search?q=@@VALUE@@&format=json
|external data JSON path=0
}}}
== Coordinates ==
''You may enter coordinates manually, or let the address field auto-fill them.''
{{{field|Latitude|external data property=lat}}}
{{{field|Longitude|external data property=lon}}}
{{{end template}}}
{{{standard input|save}}}
{{{standard input|cancel}}}
This form allows:
- Optional address input
- Automatic coordinate lookup via Nominatim
- Manual coordinate override
4. Dashboard Page
Create page: Dashboard:Place
= Place Dashboard =
This dashboard allows you to create and edit PLACE entities.
== Create a new Place ==
{{#formlink:form=Place|link text=Add a new Place}}
== Existing Places ==
{{#cargo_query:
table=Place;
fields=Name,Address,Latitude,Longitude;
format=table;
order=Name;
}}
This page:
- Provides a button to create new PLACE entries
- Lists all existing places
5. User Workflow
Option A — Enter address
- User types an address
- PageForms queries Nominatim
- Latitude + Longitude auto-fill
- User saves
- Dashboard shows a static map preview
- Clicking the map link opens OpenStreetMap for zooming
Option B — Enter coordinates manually
- User leaves Address blank
- User enters Latitude + Longitude manually
- Map preview still works
Both paths are supported.
6. Notes for Successors
- No JavaScript is used
- No API keys required
- No Vector‑2022 interference
- All logic is transparent and maintainable
- Nominatim is stable and free for low-volume archival use
- Static OSM maps are ideal for previews
End of work document.