Skip to content
Snippets Groups Projects
Commit 9d991f54 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1071628][MapViewTemplate:...

[Projekt: Entwicklung - Neon][TicketNr.: 1071628][MapViewTemplate: Konfiguration wird nicht richtig ausgelesen]
parent f19433d8
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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>
......
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
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
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
import("system.result");
result.string("50.989791");
\ No newline at end of file
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
import("system.result");
result.string("4.772377");
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment