Skip to content

Josephinum-Research/swagger-ui-map-plugin

Repository files navigation

SwaggerUI Map Plugin

SwaggerUI plugin to show GeoJson responses on a map

example

Usage

  1. Add Openlayers and this plugin to your swaggerui index file
<script src="https://cdn.jsdelivr.net/npm/ol@v10.1.0/dist/ol.js" crossorigin></script>
<script src="https://cdn.jsdelivr.net/npm/@josephinumresearch/swagger-ui-map-plugin/dist/swagger-ui-map-plugin.js" crossorigin></script>
  1. Register SwaggerUiMapPlugin()
SwaggerUIBundle({
    ...
    plugins: [
        SwaggerUiMapPlugin()
    ],
    ...
});
  1. Execute a request whose response is an application/geo+json

Dev

Run npm install and then npm run dev.

For deployment, build the dist/swagger-ui-map-plugin.js with npm run build and run npm publish --access public to publish.