aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 2c1bcecd1638d8d423b82b24b86cb6a2fd324dd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
discourse-openstreetmap
=======================

Discourse plugin to support OSM via URL Oneboxing and iframe whitelisting


## Installation on top of Docker image

Add to your `/var/discourse/containers/app.yml`:

```ruby
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/lidel/discourse-openstreetmap.git
```

Rebuild Discourse: `/var/discourse/launcher rebuild app`

## FAQ

### What URLs are oneboxed?

`http://www.openstreetmap.org/?mlat=[Marker Latitude]&mlon=[Marker Longitude]#map=[Zoom Level]/[Latitude]/[Longitude]&layers=[Layer code]`

### Why URLs without *Marker* parameters are not being oneboxed?

The `map` parameter is located inside URL hash.
Root URLs without query parameters are currently [ignored by onebox library](https://github.com/discourse/onebox/blob/d94d4ef7dffaf299b2b1cd673e9f7d4f3b5da9dc/lib/onebox/matcher.rb#L17).
This is a temporary inconvenience: [upstream fix is awaiting approval](https://github.com/discourse/onebox/pull/252).

### I don't like oneboxing: can't I just copy&paste `<iframe>` code from OpenStreetMap.org's share menu?

Sure you can: this plugin whitelists posting iframes from openstreetmap.org.