最新記事
カテゴリ
最新記事
カテゴリ
DokuWiki には,OpenStreetMap (OSM) の地図を閲覧できるプラグインがありますので,それを使って DokuWiki から OSM 地図を閲覧できる様にしてみます.
以下のプラグインをインストールします.
プラグインがインストールできると,文書の作成または編集をすると,編集ボックス上に,ボタンが追加されているはずです. そのボタンを押すと,以下の様なコードが挿入されます.
<olmap id="olMapOne" width="550px" height="450px" lat="50.0" lon="5.1" zoom="12" statusbar="1" controls="1" poihoverstyle="0" baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" > ~~ Plugin olmap help. ~~ Required in the above tag are values for: id (unique on this page), width, heigth. ~~ Also you will want to enter zoomlevel and lat, lon values that make sense for where you want the map to start. ~~ Below is an example of a POI, you can add as many as you want. ~~ More examples: http://dokuwiki.org/plugin:openlayersmap 50.0117,5.1287,-90,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\ external link: [[http://test.com|test.com]] \\ internal link: [[::start]]\\ **DW Formatting** </olmap>
これをそのまま保存すると,まずは取り敢えずOSM地図が閲覧できるはずです.
使い方は,読めば感覚的にも分かるかなと思います(汗.
plugin:openlayersmap は,gpx や kml のオーバーレイが出来そうですので,gpx を読み込ませてみたいと思います.
オーバーレイで描画する gpx ファイルは,DokuWiki のファイルアップロードを使いますが,DokuWiki 側で mime type を設定しないままだと,*.gpx や *.kml の拡張子を持つファイルはアップロードを受け付けませんので,mime type を設定します.
DokuWiki の mime type は,DokuWiki をインストールしたディレクトリの conf/mime.conf で決定しているようです. conf/mime.conf を読むと,冒頭に以下の記述があることから,conf/mime.local.conf を新規作成し,そのファイルで mime type を記載するのが良さそうです.
# Allowed uploadable file extensions and mimetypes are defined here. # To extend this file it is recommended to create a mime.local.conf
上記をふまえて,conf/mime.local.conf に,gpx と kml の mime type を設定します.
gpx application/gpx+xml kml application/vnd.google-earth.kml+xml
この後,DokuWiki のメディアマネージャーから,gpx や kml ファイルのアップロードが行える様になるはずです.
その後,gpxfile=“” に,アップロードした gpx ファイル名を指定すると,以下の様に GPX オーバーレイ描画された OSM 地図が閲覧できるはずです.
Various functions are available as part of the map.
Keyboard operation becomes available after activating the map using the tab key (the map will show a focus indicator ring).
It's possible that some of the functions or buttons describe above have been disabled by the page author or the administrator
id | symbol | latitude | longitude | description |
---|---|---|---|---|
![]() |
![]() |
GPX track: gpslog/gpx/sakai log |