mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 07:29:24 +08:00
* feat: add map plugin * feat: update * feat: add Map.Designer * feat: support polygon and clear canvas * feat: improve and support linestring * feat: map type default * feat: support group order * feat: support register group * feat: improve named and logic * fix: rename * feat: better * refactor: move to use postgresSQL supported type * feat: support circle * feat: support mysql * chore: @nocobase/plugin-map * fix: some error in postgres * fix: line lose * fix: accessKey or securityCode is incorrect * fix: improve * fix: shake screen in modal * feat: support serviceHOST * feat: improve * feat: support view map in detail * feat: support patten in details * fix: something went wrong in edit mode * fix: field name incorrectly * feat: support sqlite * feat: support circle in mysql * feat: support map configuration * feat: support map configuration * fix: remove unused div * feat: support show map in details * fix: disabled in details * fix: unused * feat: improve readpretty * fix: schemaInitialize * feat: improve alert and search * fix: mysql polygon not work * test: add fields test * test: improve * test: update * fix: test error * feat: improve search and support zoom * fix: if success should reset err message * feat: add isOverride to confirm * feat: improve
47 lines
947 B
TypeScript
47 lines
947 B
TypeScript
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
import { CircleField, LineStringField, PointField, PolygonField } from './fields';
|
|
import { resolve } from 'path';
|
|
import { getConfiguration, setConfiguration } from './actions';
|
|
|
|
export class MapPlugin extends Plugin {
|
|
afterAdd() { }
|
|
|
|
beforeLoad() {
|
|
const fields = {
|
|
point: PointField,
|
|
polygon: PolygonField,
|
|
lineString: LineStringField,
|
|
circle: CircleField
|
|
};
|
|
|
|
this.db.registerFieldTypes(fields);
|
|
}
|
|
|
|
|
|
async load() {
|
|
await this.db.import({
|
|
directory: resolve(__dirname, 'collections'),
|
|
});
|
|
|
|
this.app.resource(({
|
|
name: 'map-configuration',
|
|
actions: {
|
|
get: getConfiguration,
|
|
set: setConfiguration
|
|
},
|
|
only: ['get', 'set']
|
|
}))
|
|
|
|
}
|
|
|
|
async install(options?: InstallOptions) { }
|
|
|
|
async afterEnable() { }
|
|
|
|
async afterDisable() { }
|
|
|
|
async remove() { }
|
|
}
|
|
|
|
export default MapPlugin;
|