diff --git a/entity/AroundLocation_entity/entityfields/open/onActionProcess.js b/entity/AroundLocation_entity/entityfields/open/onActionProcess.js index 7f56d76e8d993a8a3237a324901b8bb8a59f5046..10fa1eeb0072f9ca47d9df86503fbd82c530de2f 100644 --- a/entity/AroundLocation_entity/entityfields/open/onActionProcess.js +++ b/entity/AroundLocation_entity/entityfields/open/onActionProcess.js @@ -34,6 +34,8 @@ var homeFeatureCollection = { }; var params = { - MapViewAdditionalFeatures_param: JSON.stringify(homeFeatureCollection) + MapViewAdditionalFeatures_param: JSON.stringify(homeFeatureCollection), + MapViewCenterLat_param: vars.get("$param.LocationLat_param"), + MapViewCenterLon_param: vars.get("$param.LocationLon_param") }; neon.openContext("Organisation", "OrganisationFilter_view", contactIds, neon.OPERATINGSTATE_SEARCH, params, null); \ No newline at end of file diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index b97cd74089ef1ad2c2fb5432609793ba4179ef48..1e6ea3c4e739f4821909e122c0dbf048d28b8643 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -148,6 +148,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> </children> <dependencies> <entityDependency> @@ -631,6 +639,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> </children> <dependencies> <entityDependency> @@ -700,6 +716,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> </children> <dependencies> <entityDependency> @@ -1067,6 +1091,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> </children> </entityProvider> <entityParameter> @@ -1290,6 +1322,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> </children> <dependencies> <entityDependency> @@ -1359,6 +1399,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> </children> </entityProvider> <entityConsumer> @@ -1407,6 +1455,14 @@ <name>MapViewAdditionalFeatures_param</name> <expose v="false" /> </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <expose v="false" /> + </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <expose v="false" /> + </entityParameter> </children> <dependencies> <entityDependency> @@ -1502,6 +1558,18 @@ <expose v="true" /> <documentation>%aditoprj%/entity/Organisation_entity/entityfields/mapviewadditionalfeatures_param/documentation.adoc</documentation> </entityParameter> + <entityParameter> + <name>MapViewCenterLat_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/mapviewcenterlat_param/valueProcess.js</valueProcess> + <expose v="true" /> + <documentation>%aditoprj%/entity/Organisation_entity/entityfields/mapviewcenterlat_param/documentation.adoc</documentation> + </entityParameter> + <entityParameter> + <name>MapViewCenterLon_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/mapviewcenterlon_param/valueProcess.js</valueProcess> + <expose v="true" /> + <documentation>%aditoprj%/entity/Organisation_entity/entityfields/mapviewcenterlon_param/documentation.adoc</documentation> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Organisation_entity/entityfields/map_config/valueProcess.js b/entity/Organisation_entity/entityfields/map_config/valueProcess.js index 6421bc7b36e025ad60e937e7d1173bbadbadc282..786d88c24f84311519bfbc011d2faba89925f2a1 100644 --- a/entity/Organisation_entity/entityfields/map_config/valueProcess.js +++ b/entity/Organisation_entity/entityfields/map_config/valueProcess.js @@ -1,12 +1,14 @@ +import("system.vars"); import("system.util"); import("system.fileIO"); import("system.result"); var config = { startingCenterPosition : { - lat: 0, - lon: 0, - zoomLevel: 0, + lat: parseFloat(vars.get("$param.MapViewCenterLat_param")), + lon: parseFloat(vars.get("$param.MapViewCenterLon_param")), + zoomLevel: 5, + //but let's try to locate the users posistion for a better view autoLocate: true }, boundaries: { @@ -22,5 +24,13 @@ var config = { ] }; +//when opening the AroundLocation view we do want to have the source organisation as center, so let's not overwrite the starting center position by +//looking for the users current location +if (vars.get("$param.MapViewAdditionalFeatures_param")) +{ + config.startingCenterPosition.zoomLevel = 10;//max amount of km is 100, so let's zoom in + config.startingCenterPosition.autoLocate = false; +} + var res = JSON.stringify(config); result.string(res); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/mapviewadditionalfeatures_param/documentation.adoc b/entity/Organisation_entity/entityfields/mapviewadditionalfeatures_param/documentation.adoc index 3c5296d3417e36b0efa672ea64456579876159ea..ec5cbf7e00db1b0c02945e69debc6b60975bb6ad 100644 --- a/entity/Organisation_entity/entityfields/mapviewadditionalfeatures_param/documentation.adoc +++ b/entity/Organisation_entity/entityfields/mapviewadditionalfeatures_param/documentation.adoc @@ -1 +1,5 @@ -You may provide a `GeoJSON` `FeatureCollection` that will be display in the `MapViewTemplate` of the `OrganisationFilter_view` here. \ No newline at end of file +You may provide a `GeoJSON` `FeatureCollection` that will be display in the `MapViewTemplate` of the `OrganisationFilter_view` here. +This is usefull for the "AroundLocation"-Search. + +If this param is passed the map view will not autolocate your position and center the view based on the parameters `MapViewCenterLat_param` and +`MapViewCenterLon_param` \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/mapviewcenterlat_param/documentation.adoc b/entity/Organisation_entity/entityfields/mapviewcenterlat_param/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..f92fe01e05c83b2494bda29e055703b4c0361734 --- /dev/null +++ b/entity/Organisation_entity/entityfields/mapviewcenterlat_param/documentation.adoc @@ -0,0 +1,2 @@ +Pass a valid default decimal (or string-decimal) latitude-value to set the default center position of the Map-view which is based on the parameters +`MapViewCenterLat_param` and `MapViewCenterLon_param`. \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/mapviewcenterlat_param/valueProcess.js b/entity/Organisation_entity/entityfields/mapviewcenterlat_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..75f0dea1eb7137a40bac5eccca2c2e06bcc753d8 --- /dev/null +++ b/entity/Organisation_entity/entityfields/mapviewcenterlat_param/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("50.989791"); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/mapviewcenterlon_param/documentation.adoc b/entity/Organisation_entity/entityfields/mapviewcenterlon_param/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..ede2490bd8ba1bca620a1802bebb2d0c441748fc --- /dev/null +++ b/entity/Organisation_entity/entityfields/mapviewcenterlon_param/documentation.adoc @@ -0,0 +1,2 @@ +Pass a valid default decimal (or string-decimal) longitude-value to set the default center position of the Map-view which is based on the parameters +`MapViewCenterLat_param` and `MapViewCenterLon_param`. \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/mapviewcenterlon_param/valueProcess.js b/entity/Organisation_entity/entityfields/mapviewcenterlon_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2cdca40931a3a2e532a2d0d1d13bc70c7d955238 --- /dev/null +++ b/entity/Organisation_entity/entityfields/mapviewcenterlon_param/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("4.772377"); \ No newline at end of file