Skip to content

Commit

Permalink
Merge pull request #21 from Kanahiro/menu
Browse files Browse the repository at this point in the history
Menu
  • Loading branch information
Kanahiro authored Aug 25, 2024
2 parents e0f4665 + 7e2619c commit c991793
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

1. Install the extension
2. open `style.json` in editor
3. open command palette and run `MapLibre: Launch Editor`
3. open command palette and run `MapLibre: Launch Viewer`
- ![](https://github.com/Kanahiro/maplibre-vscode-extension/blob/main/doc/palette.png?raw=true)
4. Viewer will open in new tab. When edit `style.json`, the viewer will update automatically.
- ![](https://github.com/Kanahiro/maplibre-vscode-extension/blob/main/doc/viewer.png?raw=true)
Expand All @@ -28,6 +28,7 @@
"openmaptiles": {
"type": "vector",
"url": "pmtiles://https://tile.openstreetmap.jp/static/planet-20240729.pmtiles"
// "tiles": ["pmtiles://https://tile.openstreetmap.jp/static/planet-20240729.pmtiles/{z}/{x}/{y}"] is also okay
},
"takeshima": {
"type": "vector",
Expand Down
31 changes: 27 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "MapLibre",
"description": "",
"publisher": "kiguchi",
"version": "0.0.12",
"version": "0.0.13",
"engines": {
"vscode": "^1.92.0"
},
Expand All @@ -21,10 +21,33 @@
],
"commands": [
{
"command": "maplibre.launch_editor",
"title": "MapLibre: Launch Editor"
"command": "maplibre.launch_viewer",
"title": "MapLibre: Launch Viewer"
}
]
],
"menus": {
"explorer/context": [
{
"command": "maplibre.launch_viewer",
"when": "resourceFilename =~ /.*style\\.json$/",
"group": "navigation"
}
],
"editor/title": [
{
"command": "maplibre.launch_viewer",
"when": "resourceFilename =~ /.*style\\.json$/",
"group": "navigation"
}
],
"editor/title/context": [
{
"command": "maplibre.launch_viewer",
"when": "resourceFilename =~ /.*style\\.json$/",
"group": "navigation"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run package",
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { jumpCursor, findLine } from './editor.js';

export function activate(context: vscode.ExtensionContext) {
const disposable = vscode.commands.registerCommand(
'maplibre.launch_editor',
'maplibre.launch_viewer',
() => {
const styleEditor = vscode.window.activeTextEditor!;
const panel = createWebview();
Expand Down

0 comments on commit c991793

Please sign in to comment.