-
Notifications
You must be signed in to change notification settings - Fork 0
Icons API
API Endpoint to support icon use in style editor:
-
app/api/icons/list
- GET - List of global icons.
-
app/api/icons/list/<workspace>
- GET - List of icons contained in workspace.
-
app/api/icons
- PUT - Upload any number of icons to the global styles directory.
-
app/api/icons/<workspace>
- PUT - Upload any number of icons to the workspace.
-
app/api/icons/<filename.png>
-
app/api/<workspace>/icons/<filename.png>
Icons formats:
- gif: image/gif
- jpeg: image/jpeg
- jpg: image/jpeg
- png: image/png
- svg: image/svg+xml
- properties: text/x-java-properties
- ttf: application/font-sfnt
List of icons available for use when editing a style.
- GET /api/icons/list
- GET /api/icons/list/<workspace>
HTTP 200 OK:
[{"name":"<filename.png>",
"mime":"image/png",
"format":"png",
"modified": <date>
"url": "<url>",
"used":true,
}
]
Upload provided file(s) to the global or workspaces styles folder.
- PUT /api/icons
- PUT /api/icons/<workspace>
Request body is a multipart form data value, allowing multiple files to be uploaded. File names are preserved, filename extension should and mime type are checked.
Files that do not match a supported file extension (i.e. matching a mime-type) are ignored and not copied to the workspace styles folder (check logs for warnings).
Example Request:
- POST http://horizon.boundlessgeo.com/geoserver/app/api/icons/medford
- BODY multi-part request, with file schools.properties
Response:
- HTTP 201 CREATED - list of modified icons (same format as GET )
<a name="get"/a>
Direct raw access to icon:
- api/icons/<filename.png>
- api/icons/<workspace>/<filename.png>
The response mime type is based on the file extension.
api/icons/<workspace>/<filename.png>:
- http://horizon.boundlessgeo.com/geoserver/app/api/icons/medford/police13.png <a name="delete"/a>
- http://horizon.boundlessgeo.com/geoserver/app/api/icons/medford/middle_school20.png
<a name="delete"/a>
Delete indicated icon:
- DELETE /api/icons/<filename.png>
- DELETE /api/icons/<workspace>/<filename.png>
Response:
- HTTP 204 No Content - resource was successfully removed
Response body will be empty.