Skip to content
Merged
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
211 changes: 211 additions & 0 deletions src/_locales/ja/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"extName": {
"message": "マップML拡張機能",
"description": "Extension name."
},
"extDescription": {
"message": "マップMLビューアー用の拡張機能"
},

"cmBack": {
"message": "戻る"
},
"cmForward": {
"message": "進む"
},
"cmReload": {
"message": "再読み込み"
},
"cmToggleControls": {
"message": "コントロールの切り替え"
},
"cmCopyCoords": {
"message": "コピー"
},
"cmToggleDebug": {
"message": "デバッグモードの切り替え"
},
"cmCopyMapML": {
"message": "地図"
},
"cmCopyExtent": {
"message": "範囲"
},
"cmCopyLocation": {
"message": "位置"
},
"cmPasteLayer": {
"message": "貼り付け"
},
"cmViewSource": {
"message": "地図ソースを表示"
},
"lmZoomToLayer": {
"message": "レイヤーにズーム"
},
"lmCopyLayer": {
"message": "レイヤーをコピー"
},
"lmLayerSettings": {
"message": "レイヤー設定"
},
"lmRemoveLayer": {
"message": "レイヤーを削除"
},
"lmZoomToExtent": {
"message": "サブレイヤーにズーム"
},
"lmCopyExtent": {
"message": "サブレイヤーをコピー"
},
"lmExtentSettings": {
"message": "サブレイヤー設定"
},
"lmRemoveExtent": {
"message": "サブレイヤーを削除"
},
"lmStyle": {
"message": "スタイル"
},
"lcOpacity": {
"message": "不透明度"
},
"btnZoomIn": {
"message": "拡大"
},
"btnZoomOut": {
"message": "縮小"
},
"btnAttribution": {
"message": "地図データの帰属表示"
},
"btnFullScreen": {
"message": "全画面表示"
},
"btnExitFullScreen": {
"message": "全画面を終了"
},
"btnLocTrackOn": {
"message": "現在地を表示 - 位置追跡オン"
},
"btnMyLocTrackOn": {
"message": "現在地、地図に表示中"
},
"btnLocTrackOff": {
"message": "現在地を表示 - 位置追跡オフ"
},
"btnMyLastKnownLocTrackOn": {
"message": "最後の既知の位置、地図に表示中"
},
"btnLocTrackLastKnown": {
"message": "現在地を表示 - 最後の既知の位置を表示中"
},
"btnFocusMap": {
"message": "地図にフォーカス"
},
"btnFocusControls": {
"message": "コントロールにフォーカス"
},
"btnPrevFeature": {
"message": "前のフィーチャー"
},
"btnNextFeature": {
"message": "次のフィーチャー"
},
"amZoom": {
"message": "ズームレベル"
},
"amColumn": {
"message": "列"
},
"amRow": {
"message": "行"
},
"amMaxZoom": {
"message": "最大ズームレベル、拡大無効"
},
"amMinZoom": {
"message": "最小ズームレベル、縮小無効"
},
"amZoomedOut": {
"message": "範囲外にズームアウト、戻ります"
},
"amDraggedOut": {
"message": "範囲外にドラッグ、戻ります"
},
"amEastBound": {
"message": "東の境界に到達、東へのパン無効"
},
"amWestBound": {
"message": "西の境界に到達、西へのパン無効"
},
"amNorthBound": {
"message": "北の境界に到達、北へのパン無効"
},
"amSouthBound": {
"message": "南の境界に到達、南へのパン無効"
},
"kbdShortcuts": {
"message": "キーボードショートカット"
},
"kbdMovement": {
"message": "移動キー"
},
"kbdFeature": {
"message": "フィーチャーナビゲーションキー"
},
"kbdPanUp": {
"message": "上にパン"
},
"kbdPanDown": {
"message": "下にパン"
},
"kbdPanLeft": {
"message": "左にパン"
},
"kbdPanRight": {
"message": "右にパン"
},
"kbdPanIncrement": {
"message": "パン増分"
},
"kbdZoom": {
"message": "3レベル拡大/縮小"
},
"kbdFocusMap": {
"message": "地図にフォーカス"
},
"kbdFocusControls": {
"message": "コントロールにフォーカス"
},
"kbdPrevFeature": {
"message": "前のフィーチャー"
},
"kbdNextFeature": {
"message": "次のフィーチャー"
},
"dfLayer": {
"message": "レイヤー"
},
"dfExtent": {
"message": "サブレイヤー"
},
"dfPastedLayer": {
"message": "貼り付けたレイヤー"
},
"dfFeatureCaption": {
"message": "フィーチャー"
},
"popupZoom": {
"message": "ここにズーム"
},
"popupPropName": {
"message": "プロパティ名"
},
"popupPropValue": {
"message": "プロパティ値"
},
"fIndexNoFeatures": {
"message": "フィーチャーが見つかりません"
}
}
3 changes: 2 additions & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function loadOptions() {
featureIndexOverlayOption: false,
renderMap: false,
defaultExtCoor: 'pcrs',
defaultLocCoor: 'gcrs'
defaultLocCoor: 'gcrs',
contentPreference: []
};
for (let name in options) {
let elem = document.getElementById(name);
Expand Down
15 changes: 9 additions & 6 deletions test/e2e/basics/preferred-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Preferred Content Test</title>
<script type="module" src="../../../src/dist/mapml.js"></script>
<script>
<!-- <script>
document.addEventListener('DOMContentLoaded',(e)=>{
let l, map = document.querySelector('mapml-viewer'),
prefersEverything = map.matchMedia('(prefers-map-content: image) and (prefers-map-content: tile) and (prefers-map-content: feature) and (prefers-map-content: table)').matches === 'true',
prefersEverything = map.matchMedia('(prefers-map-content: image) and (prefers-map-content: tile) and (prefers-map-content: feature) and (prefers-map-content: table)').matches === true,
t = document.querySelector('template'),
prefersFeaturesOnly = map.matchMedia('(prefers-map-content: feature) and ( not ((prefers-map-content: image) or (prefers-map-content: tile)))').matches === 'true',
prefersTiles = map.matchMedia('(prefers-map-content: tile');
prefersFeaturesOnly = map.matchMedia('(prefers-map-content: feature) and ( not ((prefers-map-content: image) or (prefers-map-content: tile)))').matches === true,
prefersImages = map.matchMedia('(prefers-map-content: image) and ( not ((prefers-map-content: feature) or (prefers-map-content: tile)))').matches === true,
prefersTiles = map.matchMedia('(prefers-map-content: tile) and ( not ((prefers-map-content: feature) or (prefers-map-content: image)))').matches === true;
if (prefersFeaturesOnly) {
l = t.content.querySelector('#features').cloneNode(true);
} else if (prefersImages) {
Expand All @@ -21,11 +22,13 @@
}
map.appendChild(l);
});
</script>
</script>-->
</head>
<body>
<mapml-viewer data-testid="viewer" style="height: 500px;width:500px;" projection="CBMTILE" zoom="8" lat="46.51231982020816" lon="-63.25669692277839" controls>
<map-layer data-testid="test-layer" label="Provinces and Territories" src="../data/cbmt-cbmtile.mapml" checked></map-layer>
<!-- this is stupid there should be a simpler way to detect no preference -->
<map-layer data-testid="test-layer" media="((prefers-map-content: image) or (not ((prefers-map-content: image) and (prefers-map-content: tile) and (prefers-map-content: feature) and (prefers-map-content: table))))" label="Provinces and Territories" src="../data/cbmt-cbmtile.mapml" checked></map-layer>
<map-layer data-testid="test-layer2" media="(prefers-map-content: feature)" label="Provinces and Territories" src="../data/features.mapml" checked></map-layer>
</mapml-viewer>
</body>
</html>
2 changes: 1 addition & 1 deletion test/e2e/basics/preferred-content.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test.describe("Preferred content test", () => {
await newPage.goto("test/e2e/basics/preferred-content.html", { waitUntil: "domcontentloaded" });
await newPage.waitForTimeout(1000);

const layer = newPage.getByTestId('test-layer');
const layer = newPage.getByTestId('test-layer2');
const label = await layer.evaluate((l) => l._layerControlLabel.textContent);
expect(label).toEqual('Feature content');
});
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/data/cbmt-cbmtile.mapml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<map-meta http-equiv="Content-Type" content="application/xml;charset=UTF-8"></map-meta>
<map-meta charset="utf-8"></map-meta>
<map-link rel="license" href="https://www.nrcan.gc.ca/earth-sciences/geography/topographic-information/free-data-geogratis/licence/17285" title="Canada Base Map © Natural Resources Canada"></map-link>
<map-link rel="style self" media="prefers-map-content=image" href="cbmt-cbmtile.mapml" title="Image content" />
<map-link rel="style" media="prefers-map-content=feature" href="features.mapml" title="Feature content" />
<!-- these don't work -->
<map-link rel="style self" media="(prefers-map-content: image)" href="cbmt-cbmtile.mapml" title="Image content" />
<map-link rel="style" media="(prefers-map-content: feature)" href="features.mapml" title="Feature content" />
</map-head>
<map-body>
<map-extent units="CBMTILE" checked="checked">
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/data/features.mapml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<map-head>
<map-title>Feature content</map-title>
<map-meta charset="utf-8"></map-meta>
<map-link rel="style" media="prefers-map-content=image" href="cbmt-cbmtile.mapml" title="Image content" />
<map-link rel="style self" media="prefers-map-content=feature" href="features.mapml" title="Feature content" />
<!-- these don't work -->
<map-link rel="style" media="(prefers-map-content: image)" href="cbmt-cbmtile.mapml" title="Image content" />
<map-link rel="style self" media="(prefers-map-content: feature)" href="features.mapml" title="Feature content" />
</map-head>
<map-body>
<map-extent units="CBMTILE" checked="checked">
Expand Down