diff --git a/js/visualisation/worldmap2d_example10.js b/js/visualisation/worldmap2d_example10.js index 374ef4c..7d0049d 100644 --- a/js/visualisation/worldmap2d_example10.js +++ b/js/visualisation/worldmap2d_example10.js @@ -5,86 +5,45 @@ var worldmap2d_example10_options = { datasources: new Map([ ['../../data/visualisation/worldmap2d/tbl_observedobject.json', { - datacapsule: { - fromName: '../../data/visualisation/worldmap2d/tbl_observedobject.json', - }, - latitudeAttr: 'tbl_location.coordinates[0]', - longitudeAttr: 'tbl_location.coordinates[1]', - }], + datacapsule: { + fromName: '../../data/visualisation/worldmap2d/tbl_observedobject.json' + }, + latitudeAttr: 'latitude', + longitudeAttr: 'longitude' + }] ]), zoom: 18, showTimedDataAtOnce: true, clusterMarkers: true, - maxZoom: 18, + maxZoom: 18 }; //add plugin to the worldmap2d component worldmap2d_example10_options.plugins = new Map(); -worldmap2d_example10_options.plugins.set('ToggleClickInteractionButton', { - id: 'toggleclickinteractionbutton', +worldmap2d_example10_options.plugins.set('CreateObjectModal', { + id: 'createobjectmodal', active: true }); -worldmap2d_example10_options.plugins.set('CreateMeasurementModal', { - id: 'createmeasurementmodal', - active: true -}); - -var createmeasurementmodal_worldmap2d_example10_options = { - typeDatasource: '../../data/visualisation/worldmap2d/tbl_observedobject_type.json', - datacapsuleLoad: worldmap2d_example10_options.datasources.get('../../data/visualisation/worldmap2d/tbl_observedobject.json').datacapsule, - // createOoWithLocation: { - // fromName: 'observedobject/createWithLocation', - // responseIdAttr: 'ooId', - // ooName: 'ooName', - // ooDescription: 'ooDescription', - // ooType: 'ooType', - // ooCompleted: 'ooCompleted', - // ooCollection: 'ooCollection', - // locLatitude: 'locLatitude', - // locLongitude: 'locLongitude', - // locName: 'locName', - // locDescription: 'locDescription', - // } -} - -worldmap2d_example10_options.plugins.set('MapPinModal', { - id: 'mappinmodal', - active: true -}); - -var mappinmodal_worldmap2d_example10_options = { - table_names : { - locations_table: { - table_name: 'tbl_location', - idAttr: 'id', - geojsonattr: 'coordinates', - }, - oo_table: { - table_name: 'tbl_observedobject', - idAttr: 'id', - completed: 'completed', - }, - file_table: { - table_name: 'tbl_file', - idAttr: 'id' - }, - file_join_oo_table: { - table_name: 'tbl_file_join_oo', - idAttr: 'id', - file_id: 'file_id', - oo_id: 'oo_id' - }, - uploadfile_options : { - uploadTargetURL: '/SmartFile/smartfile/file/map_pictures_Gewaesser', - docroot: '../../../' - } +var createobjectmodal_worldmap2d_example10_options = { + saveMapping: { + ooNameAttr: 'name', + ooDescriptionAttr: 'description', + ooTypeAttr: 'ootype_id', + ooParentAttr: 'parent_id', + ooCompletedAttr: 'complete', + ooDataCollectionAttr: 'data_collection', + ooMetaCollectionAttr: 'meta_collection', + locLatAttr: 'lat', + locLonAttr: 'lon', + locLatLonAttr: 'coordinates', + locNameAttr: 'name', + locDescriptionAttr: 'description', + joinOoIdAttr: 'oo_id', + joinLocIdAttr: 'loc_id' }, -} - -worldmap2d_example10_options.plugins.set('Help', { - id: 'help', - active: true -}); - + objectRequestor: { + fromName: 'tbl_observedobject' + } +}; \ No newline at end of file diff --git a/js/visualisation/worldmap2d_example11.js b/js/visualisation/worldmap2d_example11.js index 89be093..9d0292b 100644 --- a/js/visualisation/worldmap2d_example11.js +++ b/js/visualisation/worldmap2d_example11.js @@ -30,27 +30,32 @@ worldmap2d_example11_options.plugins.set('ToggleClickInteractionButton', { id: 'toggleclickinteractionbutton', active: true }); -worldmap2d_example11_options.plugins.set('CreateMeasurementModal', { - id: 'createmeasurementmodal', +worldmap2d_example10_options.plugins.set('CreateObjectModal', { + id: 'createobjectmodal', active: true }); -var createmeasurementmodal_worldmap2d_example11_options = { - datacapsuleLoad: worldmap2d_example11_options.datasources.get('tbl_observedobject').datacapsule, - createOoWithLocation: { - fromName: 'observedobject/createWithLocation', - responseIdAttr: 'ooId', - ooName: 'ooName', - ooDescription: 'ooDescription', - ooType: 'ooType', - ooCompleted: 'ooCompleted', - ooCollection: 'ooCollection', - locLatitude: 'locLatitude', - locLongitude: 'locLongitude', - locName: 'locName', - locDescription: 'locDescription', +var createobjectmodal_worldmap2d_example11_options = { + saveMapping: { + ooNameAttr: 'name', + ooDescriptionAttr: 'description', + ooTypeAttr: 'ootype_id', + ooParentAttr: 'parent_id', + ooCompletedAttr: 'complete', + ooDataCollectionAttr: 'data_collection', + ooMetaCollectionAttr: 'meta_collection', + locLatAttr: 'lat', + locLonAttr: 'lon', + locLatLonAttr: 'coordinates', + locNameAttr: 'name', + locDescriptionAttr: 'description', + joinOoIdAttr: 'oo_id', + joinLocIdAttr: 'loc_id' + }, + objectRequestor: { + fromName: 'tbl_observedobject' } -} +}; worldmap2d_example11_options.plugins.set('MapPinModal', { id: 'mappinmodal', diff --git a/sites/visualisation/worldmap2d.html b/sites/visualisation/worldmap2d.html index fff9fb4..54dfad5 100644 --- a/sites/visualisation/worldmap2d.html +++ b/sites/visualisation/worldmap2d.html @@ -203,100 +203,57 @@
This customised map allows you to view and edit data.
-Note: This example requires a compatible database to display the data correctly.
+This plugin allows you to add locations and objects on the map.
Open example
+
var worldmap2d_example10_options = {
datasources: new Map([
- ['tbl_observedobject', {
- datacapsule: {
- fromName: 'tbl_1',
- fromWheres: {
- join: 'tbl_2',
+ ['../../data/visualisation/worldmap2d/tbl_observedobject.json', {
+ datacapsule: {
+ fromName: '../../data/visualisation/worldmap2d/tbl_observedobject.json'
},
- },
- latitudeAttr: 'tbl_2.coodinates.coordinates[0]',
- longitudeAttr: 'tbl_2.coodinates.coordinates[1]',
- }],
+ latitudeAttr: 'latitude',
+ longitudeAttr: 'longitude'
+ }]
]),
zoom: 18,
showTimedDataAtOnce: true,
clusterMarkers: true,
- maxZoom: 18,
+ maxZoom: 18
};
//add plugin to the worldmap2d component
worldmap2d_example10_options.plugins = new Map();
-worldmap2d_example10_options.plugins.set('ToggleClickInteractionButton', {
- id: 'toggleclickinteractionbutton',
+worldmap2d_example10_options.plugins.set('CreateObjectModal', {
+ id: 'createobjectmodal',
active: true
});
-worldmap2d_example10_options.plugins.set('CreateMeasurementModal', {
- id: 'createmeasurementmodal',
- active: true
-});
-
-var createmeasurementmodal_worldmap2d_example10_options = {
- datacapsuleLoad: worldmap2d_example10_options.datasources.get('tbl_observedobject').datacapsule,
- createOoWithLocation: {
- fromName: '',
- responseIdAttr: '',
- ooName: '',
- ooDescription: '',
- ooType: '',
- ooCompleted: '',
- ooCollection: '',
- locLatitude: '',
- locLongitude: '',
- locName: '',
- locDescription: '',
- }
-}
-
-worldmap2d_example10_options.plugins.set('MapPinModal', {
- id: 'mappinmodal',
- active: true
-});
-
-var mappinmodal_worldmap2d_example10_options = {
- table_names : {
- locations_table: {
- table_name: '',
- idAttr: '',
- geojsonattr: '',
- },
- oo_table: {
- table_name: '',
- idAttr: '',
- completed: '',
- },
- file_table: {
- table_name: '',
- idAttr: ''
- },
- file_join_oo_table: {
- table_name: '',
- idAttr: '',
- file_id: '',
- oo_id: ''
- },
- uploadfile_options : {
- uploadTargetURL: '',
- docroot: ''
- }
+var createobjectmodal_worldmap2d_example10_options = {
+ saveMapping: {
+ ooNameAttr: 'name',
+ ooDescriptionAttr: 'description',
+ ooTypeAttr: 'ootype_id',
+ ooParentAttr: 'parent_id',
+ ooCompletedAttr: 'complete',
+ ooDataCollectionAttr: 'data_collection',
+ ooMetaCollectionAttr: 'meta_collection',
+ locLatAttr: 'lat',
+ locLonAttr: 'lon',
+ locLatLonAttr: 'coordinates',
+ locNameAttr: 'name',
+ locDescriptionAttr: 'description',
+ joinOoIdAttr: 'oo_id',
+ joinLocIdAttr: 'loc_id'
},
-}
-
-worldmap2d_example10_options.plugins.set('Help', {
- id: 'help',
- active: true
-});
-
+ objectRequestor: {
+ fromName: 'tbl_observedobject'
+ }
+};