70 | | |
| 70 | === {{{load_data}}} === |
| 71 | Instruct JOSM to load OSM data, directly encoded in the URL, instead of coming from an external file. This is only suited for smaller data (some browsers limit the maximum URL length), but it is faster (since no download is required), and in many cases where dynamically generated data is needed, it's easier to generate. |
| 72 | |
| 73 | {{{ |
| 74 | GET /load_data?new_layer=(true/false)&layer_name=...&mime_type=...&data=... |
| 75 | }}} |
| 76 | where |
| 77 | ||= **Parameter** =||= **Required/Optional** =||= **Meaning** =|| |
| 78 | || `new_layer` || O || Chose to load the data in a new layer || |
| 79 | || `layer_name` || O || Only valid when the data is loaded in a new layer; Gives JOSM a hint on how to name the layer || |
| 80 | || `mime_type` || O || Mime type of the data, by default this is "application/x-osm+xml", which is currently the only supported mime type, but in the future other mime types could be supported || |
| 81 | || `data` || R || The XML data to load, this should be URL encoded in a way that also encodes the special characters &, = and ? to resp. %26, %3D and %3F. The JS [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent encodeUriComponent()] method provides this functionality out of the box. || |