-
-
Notifications
You must be signed in to change notification settings - Fork 57
Tutorials
Step-by-step guides for setting up and deploying a Maplat application.
Note (2026-07): This page is based on the Maplat 0.2.6 era (August 2018) documentation. The current version (0.12.2) has a significantly different application structure and distribution format (ESM / CDN / npm package
@maplat/ui). For the latest quick start, see the README.
- 1. Download the sample package
- 2. Inspect the sample package contents
- 3. After creating maps with MaplatEditor
- 4. Configure apps/sample.json
- 5. Controlling app behavior via query string
- 6. Other configuration samples
- See Also
First, download the Maplat sample package from
this link.
It is a zip file, so extract it. Place the extracted contents on a web server
and access index.html — the sample Maplat with two Morioka historical maps
will run.
Due to modern browser file-access security settings, Maplat cannot run from a local folder directly. Place it on a web server.
Once the sample runs, proceed to the next step.
The package has roughly the following structure:
├apps
│ └sample.json
├dist
│ └several js/css files
├fonts
│ └several font files
├img
│ └several image files
├index.html
├locales
│ └several i18n files/folders
├maps
│ └several map definition json files
├parts
│ └several UI part images
├tiles
│ └several map tile folders
└tmbs
└several thumbnail files for map selector UI
Files/folders that do not need modification:
-
distfolder -
fontsfolder -
index.html(unless you renameapps/sample.json) -
localesfolder -
partsfolder -
tmbs/gsi_menu.jpg,tmbs/osm_menu.jpg
Files that must be edited:
apps/sample.json
Folders whose contents must be replaced:
-
img— images referenced by POI definitions inapps/sample.json -
maps— compiled map definition JSON files generated by MaplatEditor -
tiles— map tile folders generated by MaplatEditor -
tmbs— thumbnail images for the map selector UI (manually create 52px-long-edge images named{mapID}_menu.jpg)
After editing a map in MaplatEditor, the workflow is:
- Delete the JSON files in the sample
mapsfolder, then copy the desired compiled JSON files from MaplatEditor's output. - Delete the tile folders in the sample
tilesfolder, then copy the desired tile folders from MaplatEditor's output. - Delete the JPG files in
tmbs(exceptgsi_menu.jpgandosm_menu.jpg), then place manually created thumbnails for each map ID. - Rewrite
apps/sample.jsonas described in the next section. - Delete images in the
imgfolder, then place any POI images referenced byapps/sample.json.
The apps/sample.json file looks like this:
{
"app_name" : {
"ja" : "盛岡市古地図アプリ",
"en" : "Historical Map Application of Morioka"
},
"lang" : "ja",
"fake_gps" : true,
"fake_center" : {
"ja" : "盛岡市",
"en" : "Morioka"
},
"fake_radius" : 10,
"home_position" : [141.149989, 39.699952],
"default_zoom" : 17,
"sources" : [
{ "mapID" : "morioka_ndl" },
{ "mapID" : "morioka" },
"gsi",
"osm"
],
"pois" : [
{
"name" : { "ja" : "盛岡城", "en" : "Morioka Castle" },
"address" : "岩手県盛岡市内丸1-37",
"lat" : 39.69994722,
"lng" : 141.1501111,
"desc" : "南部(盛岡)藩南部氏の居城...",
"image" : "moriokajo.jpg"
}
]
}Key fields to change:
-
app_name— application title -
home_position— center coordinates[longitude, latitude]at start -
sources— list of map IDs. Keep"gsi"and"osm"(shortcut strings). Other maps use{ "mapID": "..." }form. -
pois— POI definitions. If no POIs, keep"pois": []. If a POI has an"image", place that image in theimgfolder.
Note: The field names above (
app_name,fake_gps,home_position) are the 0.2.6-era snake_case form. The current version uses camelCase (appName,fakeGps,homePosition). See Concepts for the current data format and the README for the latest API.
See App-data-format (archived in Concepts) for the full schema.
With the app running at http://localhost/, you can control behavior via query strings:
| Query | Effect |
|---|---|
?appid=hoge |
Load hoge.json instead of sample.json
|
?lang=en |
Force English UI (normally auto-detected from browser settings) |
?overlay=true |
Show historical map as an overlay on the standard map |
You can also bake these defaults into index.html by setting the option object:
var option = {
appid: "hoge",
lang: "en",
overlay: true
};The app configuration supports many more features, including:
- TMS/WMTS historical maps as base or overlay sources
- Displaying external websites (e.g. Wikipedia) as POI content
Sample configuration files for reference:
日本語版はこちら / Read this page in Japanese
- Home
- Concepts — data format details
- API-Reference — API concepts and usage patterns
- README — latest quick start
- 🇬🇧 English (Home)
- 🇯🇵 日本語 (Home.ja)
English
日本語
- 📄 README / README.ja
- 🗺️ Ecosystem Map(現在外部非公開)
- 🌐 Product site / 製品サイト
- 🏢 Nayuta, Inc. / コーポレートサイト