From 8872ec19b641b827cc4ca413825ddce911b33b14 Mon Sep 17 00:00:00 2001 From: nordmif Date: Tue, 11 Dec 2018 20:11:12 +0200 Subject: [PATCH 01/20] fixed conflicts --- .../server/controller/TelemetryController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java b/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java index bebd2cc4d3..4748c22e25 100644 --- a/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java +++ b/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java @@ -279,8 +279,14 @@ public class TelemetryController extends BaseController { deleteFromTs = 0L; deleteToTs = System.currentTimeMillis(); } else { - deleteFromTs = startTs; - deleteToTs = endTs; + if (startTs == null || endTs == null) { + deleteToTs = endTs; + return getImmediateDeferredResult("When deleteAllDataForKeys is false, start and end timestamp values shouldn't be empty", HttpStatus.BAD_REQUEST); + } + else{ + deleteFromTs = startTs; + deleteToTs = endTs; + } } return accessValidator.validateEntityAndCallback(user, entityIdStr, (result, tenantId, entityId) -> { From 3ec0a7036334669ee6e98a06f629982dac3c3204 Mon Sep 17 00:00:00 2001 From: nordmif Date: Wed, 26 Dec 2018 20:23:35 +0200 Subject: [PATCH 02/20] fixed URL templating --- application/pom.xml | 4 ++++ .../org/thingsboard/server/config/SwaggerConfiguration.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/application/pom.xml b/application/pom.xml index 6280d0031f..d7b560189e 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -264,6 +264,10 @@ org.javadelight delight-nashorn-sandbox + + io.springfox.ui + springfox-swagger-ui-rfc6570 + diff --git a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java index 2254cf3da0..52eef828f8 100644 --- a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java @@ -64,7 +64,8 @@ public class SwaggerConfiguration { .paths(apiPaths()) .build() .securitySchemes(newArrayList(jwtTokenKey())) - .securityContexts(newArrayList(securityContext())); + .securityContexts(newArrayList(securityContext())) + .enableUrlTemplating(true); } private ApiKey jwtTokenKey() { From d3ee9ade3c758fb46dbf2a2f484c9cad4553c232 Mon Sep 17 00:00:00 2001 From: nordmif Date: Wed, 26 Dec 2018 20:31:20 +0200 Subject: [PATCH 03/20] added springfox version --- application/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/application/pom.xml b/application/pom.xml index d7b560189e..4af0ad45ec 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -267,6 +267,7 @@ io.springfox.ui springfox-swagger-ui-rfc6570 + 1.0.0 From 17b2eaf350c33df0b82582feb76a3ac9cdf45a57 Mon Sep 17 00:00:00 2001 From: nordmif Date: Thu, 27 Dec 2018 16:21:16 +0200 Subject: [PATCH 04/20] moved dependency declaration --- application/pom.xml | 5 ----- pom.xml | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/application/pom.xml b/application/pom.xml index 4af0ad45ec..6280d0031f 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -264,11 +264,6 @@ org.javadelight delight-nashorn-sandbox - - io.springfox.ui - springfox-swagger-ui-rfc6570 - 1.0.0 - diff --git a/pom.xml b/pom.xml index b3182f74ff..bfb5caa1ce 100755 --- a/pom.xml +++ b/pom.xml @@ -70,6 +70,7 @@ 2.19.1 3.0.2 2.6.1 + 1.0.0 1.56 2.0.1 2.4.0 @@ -794,6 +795,11 @@ bucket4j-core ${bucket4j.version} + + io.springfox.ui + springfox-swagger-ui-rfc6570 + ${springfox-swagger-ui-rfc6570.version} + From 2f86547b195e5068f389f307b7489506bb1467e9 Mon Sep 17 00:00:00 2001 From: nordmif Date: Thu, 27 Dec 2018 17:02:40 +0200 Subject: [PATCH 05/20] further fix --- application/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/pom.xml b/application/pom.xml index 6280d0031f..d7b560189e 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -264,6 +264,10 @@ org.javadelight delight-nashorn-sandbox + + io.springfox.ui + springfox-swagger-ui-rfc6570 + From 86f5b3fd08b39d50af9949f8cef32979a9eb8db7 Mon Sep 17 00:00:00 2001 From: nordmif Date: Thu, 27 Dec 2018 17:46:41 +0200 Subject: [PATCH 06/20] more fixes --- application/pom.xml | 1 + pom.xml | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/application/pom.xml b/application/pom.xml index d7b560189e..88b40946ad 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -267,6 +267,7 @@ io.springfox.ui springfox-swagger-ui-rfc6570 + ${springfox-swagger-ui-rfc6570.version} diff --git a/pom.xml b/pom.xml index bfb5caa1ce..530f39d42e 100755 --- a/pom.xml +++ b/pom.xml @@ -795,11 +795,6 @@ bucket4j-core ${bucket4j.version} - - io.springfox.ui - springfox-swagger-ui-rfc6570 - ${springfox-swagger-ui-rfc6570.version} - From cc0f559651cf1a1e11aafcf37a8d3e6068109b78 Mon Sep 17 00:00:00 2001 From: nordmif Date: Thu, 27 Dec 2018 18:58:28 +0200 Subject: [PATCH 07/20] optimized import --- .../server/actors/ruleChain/RuleNodeActorMessageProcessor.java | 1 - 1 file changed, 1 deletion(-) diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java index 7f200e176e..452b9d7eb8 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java @@ -17,7 +17,6 @@ package org.thingsboard.server.actors.ruleChain; import akka.actor.ActorContext; import akka.actor.ActorRef; -import akka.event.LoggingAdapter; import org.thingsboard.rule.engine.api.TbContext; import org.thingsboard.rule.engine.api.TbNode; import org.thingsboard.rule.engine.api.TbNodeConfiguration; From 9805828b802f4a532c852b7fb0fadd8b88fc244c Mon Sep 17 00:00:00 2001 From: nordmif Date: Thu, 27 Dec 2018 20:06:18 +0200 Subject: [PATCH 08/20] reverting to first version to check --- application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/pom.xml b/application/pom.xml index 88b40946ad..4af0ad45ec 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -267,7 +267,7 @@ io.springfox.ui springfox-swagger-ui-rfc6570 - ${springfox-swagger-ui-rfc6570.version} + 1.0.0 From 829f8a9786c5faea54f32459aac09a12fd715e6d Mon Sep 17 00:00:00 2001 From: nordmif Date: Fri, 28 Dec 2018 12:09:35 +0200 Subject: [PATCH 09/20] reverted to version before new dependency --- application/pom.xml | 10 +++++----- .../server/config/SwaggerConfiguration.java | 4 ++-- pom.xml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/pom.xml b/application/pom.xml index 4af0ad45ec..f9b9850af5 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -264,11 +264,11 @@ org.javadelight delight-nashorn-sandbox - - io.springfox.ui - springfox-swagger-ui-rfc6570 - 1.0.0 - + + + + + diff --git a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java index 52eef828f8..ce27a6c48f 100644 --- a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java @@ -64,8 +64,8 @@ public class SwaggerConfiguration { .paths(apiPaths()) .build() .securitySchemes(newArrayList(jwtTokenKey())) - .securityContexts(newArrayList(securityContext())) - .enableUrlTemplating(true); + .securityContexts(newArrayList(securityContext())); + //.enableUrlTemplating(true); } private ApiKey jwtTokenKey() { diff --git a/pom.xml b/pom.xml index 530f39d42e..11181f4e87 100755 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.19.1 3.0.2 2.6.1 - 1.0.0 + 1.56 2.0.1 2.4.0 From 4f2a68a72c6c769c55bc0890a77a9f6737941384 Mon Sep 17 00:00:00 2001 From: nordmif Date: Fri, 28 Dec 2018 12:57:53 +0200 Subject: [PATCH 10/20] added dependency with version in correct place --- application/pom.xml | 10 +++++----- .../server/config/SwaggerConfiguration.java | 4 ++-- pom.xml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/pom.xml b/application/pom.xml index f9b9850af5..88b40946ad 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -264,11 +264,11 @@ org.javadelight delight-nashorn-sandbox - - - - - + + io.springfox.ui + springfox-swagger-ui-rfc6570 + ${springfox-swagger-ui-rfc6570.version} + diff --git a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java index ce27a6c48f..52eef828f8 100644 --- a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java @@ -64,8 +64,8 @@ public class SwaggerConfiguration { .paths(apiPaths()) .build() .securitySchemes(newArrayList(jwtTokenKey())) - .securityContexts(newArrayList(securityContext())); - //.enableUrlTemplating(true); + .securityContexts(newArrayList(securityContext())) + .enableUrlTemplating(true); } private ApiKey jwtTokenKey() { diff --git a/pom.xml b/pom.xml index 11181f4e87..530f39d42e 100755 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.19.1 3.0.2 2.6.1 - + 1.0.0 1.56 2.0.1 2.4.0 From 4366178b88b48ac727138c3fc6194b9d46c30213 Mon Sep 17 00:00:00 2001 From: nordmif Date: Fri, 28 Dec 2018 15:01:00 +0200 Subject: [PATCH 11/20] added to dependencyManagement --- application/pom.xml | 1 - pom.xml | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/application/pom.xml b/application/pom.xml index 88b40946ad..d7b560189e 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -267,7 +267,6 @@ io.springfox.ui springfox-swagger-ui-rfc6570 - ${springfox-swagger-ui-rfc6570.version} diff --git a/pom.xml b/pom.xml index 530f39d42e..bfb5caa1ce 100755 --- a/pom.xml +++ b/pom.xml @@ -795,6 +795,11 @@ bucket4j-core ${bucket4j.version} + + io.springfox.ui + springfox-swagger-ui-rfc6570 + ${springfox-swagger-ui-rfc6570.version} + From 671a0b579ef2b6850311b3ba8c3cdfffb9a34747 Mon Sep 17 00:00:00 2001 From: Dima Landiak Date: Thu, 4 Apr 2019 13:55:45 +0300 Subject: [PATCH 12/20] events debug mode rate limits added --- .../server/actors/ActorSystemContext.java | 139 +++++++++++++----- .../actors/tenant/DebugTbRateLimits.java | 29 ++++ .../controller/RuleChainController.java | 27 +++- .../src/main/resources/thingsboard.yml | 3 + .../server/common/data/DataConstants.java | 1 + 5 files changed, 159 insertions(+), 40 deletions(-) create mode 100644 application/src/main/java/org/thingsboard/server/actors/tenant/DebugTbRateLimits.java diff --git a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java index c35aae1fd6..42b66a73e8 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java +++ b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java @@ -36,6 +36,7 @@ import org.springframework.stereotype.Component; import org.thingsboard.rule.engine.api.MailService; import org.thingsboard.rule.engine.api.RuleChainTransactionService; import org.thingsboard.server.actors.service.ActorService; +import org.thingsboard.server.actors.tenant.DebugTbRateLimits; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.Event; import org.thingsboard.server.common.data.id.EntityId; @@ -43,6 +44,7 @@ import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; import org.thingsboard.server.common.msg.TbMsg; import org.thingsboard.server.common.msg.cluster.ServerAddress; +import org.thingsboard.server.common.msg.tools.TbRateLimits; import org.thingsboard.server.common.transport.auth.DeviceAuthService; import org.thingsboard.server.dao.alarm.AlarmService; import org.thingsboard.server.dao.asset.AssetService; @@ -84,6 +86,8 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; @Slf4j @Component @@ -92,6 +96,12 @@ public class ActorSystemContext { protected final ObjectMapper mapper = new ObjectMapper(); + private final ConcurrentMap debugPerTenantLimits = new ConcurrentHashMap<>(); + + public ConcurrentMap getDebugPerTenantLimits() { + return debugPerTenantLimits; + } + @Getter @Setter private ActorService actorService; @@ -291,6 +301,14 @@ public class ActorSystemContext { @Getter private long sessionReportTimeout; + @Value("${actors.rule.chain.debug_mode_rate_limits_per_tenant.enabled}") + @Getter + private boolean debugPerTenantEnabled; + + @Value("${actors.rule.chain.debug_mode_rate_limits_per_tenant.configuration}") + @Getter + private String debugPerTenantLimitsConfiguration; + @Getter @Setter private ActorSystem actorSystem; @@ -318,8 +336,6 @@ public class ActorSystemContext { @Getter private CassandraBufferedRateExecutor cassandraBufferedRateExecutor; - - public ActorSystemContext() { config = ConfigFactory.parseResources(AKKA_CONF_FILE_NAME).withFallback(ConfigFactory.load()); } @@ -392,46 +408,97 @@ public class ActorSystemContext { } private void persistDebugAsync(TenantId tenantId, EntityId entityId, String type, TbMsg tbMsg, String relationType, Throwable error) { - try { - Event event = new Event(); - event.setTenantId(tenantId); - event.setEntityId(entityId); - event.setType(DataConstants.DEBUG_RULE_NODE); - - String metadata = mapper.writeValueAsString(tbMsg.getMetaData().getData()); - - ObjectNode node = mapper.createObjectNode() - .put("type", type) - .put("server", getServerAddress()) - .put("entityId", tbMsg.getOriginator().getId().toString()) - .put("entityName", tbMsg.getOriginator().getEntityType().name()) - .put("msgId", tbMsg.getId().toString()) - .put("msgType", tbMsg.getType()) - .put("dataType", tbMsg.getDataType().name()) - .put("relationType", relationType) - .put("data", tbMsg.getData()) - .put("metadata", metadata); - - if (error != null) { - node = node.put("error", toString(error)); + if (checkLimits(tenantId, tbMsg, error)) { + try { + Event event = new Event(); + event.setTenantId(tenantId); + event.setEntityId(entityId); + event.setType(DataConstants.DEBUG_RULE_NODE); + + String metadata = mapper.writeValueAsString(tbMsg.getMetaData().getData()); + + ObjectNode node = mapper.createObjectNode() + .put("type", type) + .put("server", getServerAddress()) + .put("entityId", tbMsg.getOriginator().getId().toString()) + .put("entityName", tbMsg.getOriginator().getEntityType().name()) + .put("msgId", tbMsg.getId().toString()) + .put("msgType", tbMsg.getType()) + .put("dataType", tbMsg.getDataType().name()) + .put("relationType", relationType) + .put("data", tbMsg.getData()) + .put("metadata", metadata); + + if (error != null) { + node = node.put("error", toString(error)); + } + + event.setBody(node); + ListenableFuture future = eventService.saveAsync(event); + Futures.addCallback(future, new FutureCallback() { + @Override + public void onSuccess(@Nullable Event event) { + + } + + @Override + public void onFailure(Throwable th) { + log.error("Could not save debug Event for Node", th); + } + }); + } catch (IOException ex) { + log.warn("Failed to persist rule node debug message", ex); } + } + } - event.setBody(node); - ListenableFuture future = eventService.saveAsync(event); - Futures.addCallback(future, new FutureCallback() { - @Override - public void onSuccess(@Nullable Event event) { + private boolean checkLimits(TenantId tenantId, TbMsg tbMsg, Throwable error) { + if (debugPerTenantEnabled) { + DebugTbRateLimits debugTbRateLimits = debugPerTenantLimits.computeIfAbsent(tenantId, id -> + new DebugTbRateLimits(new TbRateLimits(debugPerTenantLimitsConfiguration), false)); + if (!debugTbRateLimits.getTbRateLimits().tryConsume()) { + if (!debugTbRateLimits.isRuleChainEventSaved()) { + persistRuleChainDebugModeEvent(tenantId, tbMsg.getRuleChainId(), error); + debugTbRateLimits.setRuleChainEventSaved(true); } - - @Override - public void onFailure(Throwable th) { - log.error("Could not save debug Event for Node", th); + if (log.isTraceEnabled()) { + log.trace("[{}] Tenant level debug mode rate limit detected: {}", tenantId, tbMsg); } - }); - } catch (IOException ex) { - log.warn("Failed to persist rule node debug message", ex); + return false; + } + } + return true; + } + + private void persistRuleChainDebugModeEvent(TenantId tenantId, EntityId entityId, Throwable error) { + Event event = new Event(); + event.setTenantId(tenantId); + event.setEntityId(entityId); + event.setType(DataConstants.DEBUG_RULE_CHAIN); + + ObjectNode node = mapper.createObjectNode() + //todo: what fields are needed here? + .put("server", getServerAddress()) + .put("message", "Reached debug mode rate limit!"); + + if (error != null) { + node = node.put("error", toString(error)); } + + event.setBody(node); + ListenableFuture future = eventService.saveAsync(event); + Futures.addCallback(future, new FutureCallback() { + @Override + public void onSuccess(@Nullable Event event) { + + } + + @Override + public void onFailure(Throwable th) { + log.error("Could not save debug Event for Rule Chain", th); + } + }); } public static Exception toException(Throwable error) { diff --git a/application/src/main/java/org/thingsboard/server/actors/tenant/DebugTbRateLimits.java b/application/src/main/java/org/thingsboard/server/actors/tenant/DebugTbRateLimits.java new file mode 100644 index 0000000000..7ae764392c --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/actors/tenant/DebugTbRateLimits.java @@ -0,0 +1,29 @@ +/** + * Copyright © 2016-2019 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.actors.tenant; + +import lombok.AllArgsConstructor; +import lombok.Data; +import org.thingsboard.server.common.msg.tools.TbRateLimits; + +@Data +@AllArgsConstructor +public class DebugTbRateLimits { + + private TbRateLimits tbRateLimits; + private boolean ruleChainEventSaved; + +} diff --git a/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java b/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java index 2b0387049d..14fffc7486 100644 --- a/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java +++ b/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.util.StringUtils; @@ -34,6 +35,8 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; import org.thingsboard.rule.engine.api.ScriptEngine; +import org.thingsboard.server.actors.ActorSystemContext; +import org.thingsboard.server.actors.tenant.DebugTbRateLimits; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.Event; @@ -56,10 +59,10 @@ import org.thingsboard.server.service.script.RuleNodeJsScriptEngine; import org.thingsboard.server.service.security.permission.Operation; import org.thingsboard.server.service.security.permission.Resource; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentMap; import java.util.stream.Collectors; @Slf4j @@ -78,6 +81,12 @@ public class RuleChainController extends BaseController { @Autowired private JsInvokeService jsInvokeService; + @Autowired(required = false) + private ActorSystemContext actorContext; + + @Value("${actors.rule.chain.debug_mode_rate_limits_per_tenant.enabled}") + private boolean debugPerTenantEnabled; + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") @RequestMapping(value = "/ruleChain/{ruleChainId}", method = RequestMethod.GET) @ResponseBody @@ -182,8 +191,17 @@ public class RuleChainController extends BaseController { @ResponseBody public RuleChainMetaData saveRuleChainMetaData(@RequestBody RuleChainMetaData ruleChainMetaData) throws ThingsboardException { try { + TenantId tenantId = getTenantId(); + if (debugPerTenantEnabled) { + ConcurrentMap debugPerTenantLimits = actorContext.getDebugPerTenantLimits(); + DebugTbRateLimits debugTbRateLimits = debugPerTenantLimits.getOrDefault(tenantId, null); + if (debugTbRateLimits != null) { + debugPerTenantLimits.remove(tenantId, debugTbRateLimits); + } + } + RuleChain ruleChain = checkRuleChain(ruleChainMetaData.getRuleChainId(), Operation.WRITE); - RuleChainMetaData savedRuleChainMetaData = checkNotNull(ruleChainService.saveRuleChainMetaData(getTenantId(), ruleChainMetaData)); + RuleChainMetaData savedRuleChainMetaData = checkNotNull(ruleChainService.saveRuleChainMetaData(tenantId, ruleChainMetaData)); actorService.onEntityStateChange(ruleChain.getTenantId(), ruleChain.getId(), ComponentLifecycleEvent.UPDATED); @@ -236,7 +254,7 @@ public class RuleChainController extends BaseController { referencingRuleChainIds.remove(ruleChain.getId()); referencingRuleChainIds.forEach(referencingRuleChainId -> - actorService.onEntityStateChange(ruleChain.getTenantId(), referencingRuleChainId, ComponentLifecycleEvent.UPDATED)); + actorService.onEntityStateChange(ruleChain.getTenantId(), referencingRuleChainId, ComponentLifecycleEvent.UPDATED)); actorService.onEntityStateChange(ruleChain.getTenantId(), ruleChain.getId(), ComponentLifecycleEvent.DELETED); @@ -291,7 +309,8 @@ public class RuleChainController extends BaseController { String data = inputParams.get("msg").asText(); JsonNode metadataJson = inputParams.get("metadata"); - Map metadata = objectMapper.convertValue(metadataJson, new TypeReference>() {}); + Map metadata = objectMapper.convertValue(metadataJson, new TypeReference>() { + }); String msgType = inputParams.get("msgType").asText(); String output = ""; String errorText = ""; diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 1069f9d6e6..12071a203e 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -210,6 +210,9 @@ actors: chain: # Errors for particular actor are persisted once per specified amount of milliseconds error_persist_frequency: "${ACTORS_RULE_CHAIN_ERROR_FREQUENCY:3000}" + debug_mode_rate_limits_per_tenant: + enabled: "${ACTORS_RULE_CHAIN_DEBUG_MODE_RATE_LIMITS_PER_TENANT_ENABLED:true}" + configuration: "${ACTORS_RULE_CHAIN_DEBUG_MODE_RATE_LIMITS_PER_TENANT_CONFIGURATION:1000:3600}" node: # Errors for particular actor are persisted once per specified amount of milliseconds error_persist_frequency: "${ACTORS_RULE_NODE_ERROR_FREQUENCY:3000}" diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java b/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java index 7b87fa6cd3..45aa39e8f2 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java @@ -38,6 +38,7 @@ public class DataConstants { public static final String LC_EVENT = "LC_EVENT"; public static final String STATS = "STATS"; public static final String DEBUG_RULE_NODE = "DEBUG_RULE_NODE"; + public static final String DEBUG_RULE_CHAIN = "DEBUG_RULE_CHAIN"; public static final String ONEWAY = "ONEWAY"; public static final String TWOWAY = "TWOWAY"; From 432ab721fa614bd9e2ac218efd389bec31de7985 Mon Sep 17 00:00:00 2001 From: Dima Landiak Date: Thu, 4 Apr 2019 15:39:02 +0300 Subject: [PATCH 13/20] debug rate limits change capacity in yml --- application/src/main/resources/thingsboard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 12071a203e..fa902f026a 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -212,7 +212,7 @@ actors: error_persist_frequency: "${ACTORS_RULE_CHAIN_ERROR_FREQUENCY:3000}" debug_mode_rate_limits_per_tenant: enabled: "${ACTORS_RULE_CHAIN_DEBUG_MODE_RATE_LIMITS_PER_TENANT_ENABLED:true}" - configuration: "${ACTORS_RULE_CHAIN_DEBUG_MODE_RATE_LIMITS_PER_TENANT_CONFIGURATION:1000:3600}" + configuration: "${ACTORS_RULE_CHAIN_DEBUG_MODE_RATE_LIMITS_PER_TENANT_CONFIGURATION:500:3600}" node: # Errors for particular actor are persisted once per specified amount of milliseconds error_persist_frequency: "${ACTORS_RULE_NODE_ERROR_FREQUENCY:3000}" From bf17acda0ad0239e9dad8a258b9a451038710360 Mon Sep 17 00:00:00 2001 From: Dima Landiak Date: Tue, 9 Apr 2019 16:07:16 +0300 Subject: [PATCH 14/20] set data types to null cassandra --- .../src/main/resources/thingsboard.yml | 2 + .../CassandraBaseTimeseriesDao.java | 47 +++++++++++++++++++ .../test/resources/cassandra-test.properties | 1 + 3 files changed, 50 insertions(+) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 1069f9d6e6..36767ca2d8 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -173,6 +173,8 @@ cassandra: callback_threads: "${CASSANDRA_QUERY_CALLBACK_THREADS:4}" poll_ms: "${CASSANDRA_QUERY_POLL_MS:50}" rate_limit_print_interval_ms: "${CASSANDRA_QUERY_RATE_LIMIT_PRINT_MS:10000}" + # set all data types values except target to null for the same ts on save + set_null_values_enabled: "${CASSANDRA_QUERY_SET_NULL_VALUES_ENABLED:false}" tenant_rate_limits: enabled: "${CASSANDRA_QUERY_TENANT_RATE_LIMITS_ENABLED:false}" configuration: "${CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION:1000:1,30000:60}" diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java index b46c255e08..572c5d28d8 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java +++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java @@ -94,6 +94,9 @@ public class CassandraBaseTimeseriesDao extends CassandraAbstractAsyncDao implem @Value("${cassandra.query.ts_key_value_ttl}") private long systemTtl; + @Value("${cassandra.query.set_null_values_enabled}") + private boolean setNullValuesEnabled; + private TsPartitionDate tsFormat; private PreparedStatement partitionInsertStmt; @@ -307,9 +310,13 @@ public class CassandraBaseTimeseriesDao extends CassandraAbstractAsyncDao implem @Override public ListenableFuture save(TenantId tenantId, EntityId entityId, TsKvEntry tsKvEntry, long ttl) { + List> futures = new ArrayList<>(); ttl = computeTtl(ttl); long partition = toPartitionTs(tsKvEntry.getTs()); DataType type = tsKvEntry.getDataType(); + if (setNullValuesEnabled) { + processSetNullValues(tenantId, entityId, tsKvEntry, ttl, futures, partition, type); + } BoundStatement stmt = (ttl == 0 ? getSaveStmt(type) : getSaveTtlStmt(type)).bind(); stmt.setString(0, entityId.getEntityType().name()) .setUUID(1, entityId.getId()) @@ -320,6 +327,46 @@ public class CassandraBaseTimeseriesDao extends CassandraAbstractAsyncDao implem if (ttl > 0) { stmt.setInt(6, (int) ttl); } + futures.add(getFuture(executeAsyncWrite(tenantId, stmt), rs -> null)); + return Futures.transform(Futures.allAsList(futures), result -> null); + } + + private void processSetNullValues(TenantId tenantId, EntityId entityId, TsKvEntry tsKvEntry, long ttl, List> futures, long partition, DataType type) { + switch (type) { + case LONG: + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.BOOLEAN)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.DOUBLE)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.STRING)); + break; + case BOOLEAN: + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.DOUBLE)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.LONG)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.STRING)); + break; + case DOUBLE: + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.BOOLEAN)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.LONG)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.STRING)); + break; + case STRING: + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.BOOLEAN)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.DOUBLE)); + futures.add(saveNull(tenantId, entityId, tsKvEntry, ttl, partition, DataType.LONG)); + break; + } + } + + private ListenableFuture saveNull(TenantId tenantId, EntityId entityId, TsKvEntry tsKvEntry, long ttl, long partition, DataType type) { + BoundStatement stmt = (ttl == 0 ? getSaveStmt(type) : getSaveTtlStmt(type)).bind(); + stmt.setString(0, entityId.getEntityType().name()) + .setUUID(1, entityId.getId()) + .setString(2, tsKvEntry.getKey()) + .setLong(3, partition) + .setLong(4, tsKvEntry.getTs()); + stmt.setToNull(getColumnName(type)); + if (ttl > 0) { + stmt.setInt(6, (int) ttl); + } return getFuture(executeAsyncWrite(tenantId, stmt), rs -> null); } diff --git a/dao/src/test/resources/cassandra-test.properties b/dao/src/test/resources/cassandra-test.properties index 182a10b07d..151688c41c 100644 --- a/dao/src/test/resources/cassandra-test.properties +++ b/dao/src/test/resources/cassandra-test.properties @@ -53,6 +53,7 @@ cassandra.query.buffer_size=100000 cassandra.query.concurrent_limit=1000 cassandra.query.permit_max_wait_time=20000 cassandra.query.rate_limit_print_interval_ms=30000 +cassandra.query.set_null_values_enabled=false cassandra.query.tenant_rate_limits.enabled=false cassandra.query.tenant_rate_limits.configuration=5000:1,100000:60 cassandra.query.tenant_rate_limits.print_tenant_names=false From 3aa32aecc75ef7a337fb06b77d12d6630df64c7f Mon Sep 17 00:00:00 2001 From: ShvaykaD Date: Tue, 9 Apr 2019 16:50:01 +0300 Subject: [PATCH 15/20] improvement to TbGetEntityDetailsNodes --- .../TbAbstractGetEntityDetailsNode.java | 84 ++++++++++++++----- .../metadata/TbGetCustomerDetailsNode.java | 83 ++++++++++-------- .../metadata/TbGetTenantDetailsNode.java | 28 +++---- 3 files changed, 122 insertions(+), 73 deletions(-) diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java index e9d38c91fb..d20c8d1e72 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java @@ -15,6 +15,8 @@ */ package org.thingsboard.rule.engine.metadata; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -34,9 +36,9 @@ import org.thingsboard.server.common.msg.TbMsgMetaData; import java.lang.reflect.Type; import java.util.Map; -import java.util.concurrent.ExecutionException; import static org.thingsboard.rule.engine.api.TbRelationTypes.SUCCESS; +import static org.thingsboard.rule.engine.api.util.DonAsynchron.withCallback; @Slf4j public abstract class TbAbstractGetEntityDetailsNode implements TbNode { @@ -54,19 +56,20 @@ public abstract class TbAbstractGetEntityDetailsNode ctx.tellNext(m, SUCCESS), + t -> ctx.tellFailure(msg, t), ctx.getDbCallbackExecutor()); } @Override - public void destroy() {} + public void destroy() { + } protected abstract C loadGetEntityDetailsNodeConfiguration(TbNodeConfiguration configuration) throws TbNodeException; - protected abstract TbMsg getDetails(TbContext ctx, TbMsg msg); + protected abstract ListenableFuture getDetails(TbContext ctx, TbMsg msg); + + protected abstract ListenableFuture getContactBasedListenableFuture(TbContext ctx, TbMsg msg); protected MessageData getDataAsJson(TbMsg msg) { if (this.config.isAddToMetadata()) { @@ -76,25 +79,56 @@ public abstract class TbAbstractGetEntityDetailsNode metadataMap = gson.fromJson(resultObject.toString(), TYPE); - return ctx.transformMsg(msg, msg.getType(), msg.getOriginator(), new TbMsgMetaData(metadataMap), msg.getData()); + protected ListenableFuture getTbMsgListenableFuture(TbContext ctx, TbMsg msg, MessageData messageData, String prefix) { + if (!this.config.getDetailsList().isEmpty()) { + ListenableFuture resultObject = null; + ListenableFuture contactBasedListenableFuture = getContactBasedListenableFuture(ctx, msg); + for (EntityDetails entityDetails : this.config.getDetailsList()) { + resultObject = addContactProperties(messageData.getData(), contactBasedListenableFuture, entityDetails, prefix); + } + return transformMsg(ctx, msg, resultObject, messageData); } else { - return ctx.transformMsg(msg, msg.getType(), msg.getOriginator(), msg.getMetaData(), gson.toJson(resultObject)); + return Futures.immediateFuture(msg); } } - protected JsonElement addContactProperties(JsonElement data, ContactBased entity, EntityDetails entityDetails, String prefix) { + private ListenableFuture transformMsg(TbContext ctx, TbMsg msg, ListenableFuture propertiesFuture, MessageData messageData) { + return Futures.transformAsync(propertiesFuture, jsonElement -> { + if (jsonElement != null) { + if (messageData.getDataType().equals("metadata")) { + Map metadataMap = gson.fromJson(jsonElement.toString(), TYPE); + return Futures.immediateFuture(ctx.transformMsg(msg, msg.getType(), msg.getOriginator(), new TbMsgMetaData(metadataMap), msg.getData())); + } else { + return Futures.immediateFuture(ctx.transformMsg(msg, msg.getType(), msg.getOriginator(), msg.getMetaData(), gson.toJson(jsonElement))); + } + } else { + return Futures.immediateFuture(null); + } + }); + } + + private ListenableFuture addContactProperties(JsonElement data, ListenableFuture entityFuture, EntityDetails entityDetails, String prefix) { + return Futures.transformAsync(entityFuture, contactBased -> { + if (contactBased != null) { + return Futures.immediateFuture(setProperties(contactBased, data, entityDetails, prefix)); + } else { + return Futures.immediateFuture(null); + } + }); + } + + private JsonElement setProperties(ContactBased entity, JsonElement data, EntityDetails entityDetails, String prefix) { JsonObject dataAsObject = data.getAsJsonObject(); switch (entityDetails) { case ADDRESS: - if (entity.getAddress() != null) + if (entity.getAddress() != null) { dataAsObject.addProperty(prefix + "address", entity.getAddress()); + } break; case ADDRESS2: - if (entity.getAddress2() != null) + if (entity.getAddress2() != null) { dataAsObject.addProperty(prefix + "address2", entity.getAddress2()); + } break; case CITY: if (entity.getCity() != null) dataAsObject.addProperty(prefix + "city", entity.getCity()); @@ -104,16 +138,24 @@ public abstract class TbAbstractGetEntityDetailsNode getDetails(TbContext ctx, TbMsg msg) { + return getTbMsgListenableFuture(ctx, msg, getDataAsJson(msg), CUSTOMER_PREFIX); } - private TbMsg getCustomerTbMsg(TbContext ctx, TbMsg msg, MessageData messageData) { - JsonElement resultObject = null; - if (!config.getDetailsList().isEmpty()) { - for (EntityDetails entityDetails : config.getDetailsList()) { - resultObject = addContactProperties(messageData.getData(), getCustomer(ctx, msg), entityDetails, CUSTOMER_PREFIX); + @Override + protected ListenableFuture getContactBasedListenableFuture(TbContext ctx, TbMsg msg) { + return Futures.transformAsync(getCustomer(ctx, msg), customer -> { + if (customer != null) { + return Futures.immediateFuture(customer); + } else { + return Futures.immediateFuture(null); } - return transformMsg(ctx, msg, resultObject, messageData); - } else { - return msg; - } + }); } - private Customer getCustomer(TbContext ctx, TbMsg msg) { + private ListenableFuture getCustomer(TbContext ctx, TbMsg msg) { switch (msg.getOriginator().getEntityType()) { case DEVICE: - Device device = ctx.getDeviceService().findDeviceById(ctx.getTenantId(), new DeviceId(msg.getOriginator().getId())); - if (!device.getCustomerId().isNullUid()) { - return ctx.getCustomerService().findCustomerById(ctx.getTenantId(), device.getCustomerId()); - } else { - throw new RuntimeException("Device with name '" + device.getName() + "' is not assigned to Customer."); - } + return Futures.transformAsync(ctx.getDeviceService().findDeviceByIdAsync(ctx.getTenantId(), new DeviceId(msg.getOriginator().getId())), device -> { + if (device != null) { + if (!device.getCustomerId().isNullUid()) { + return ctx.getCustomerService().findCustomerByIdAsync(ctx.getTenantId(), device.getCustomerId()); + } else { + throw new RuntimeException("Device with name '" + device.getName() + "' is not assigned to Customer."); + } + } else { + return Futures.immediateFuture(null); + } + }); case ASSET: - Asset asset = ctx.getAssetService().findAssetById(ctx.getTenantId(), new AssetId(msg.getOriginator().getId())); - if (!asset.getCustomerId().isNullUid()) { - return ctx.getCustomerService().findCustomerById(ctx.getTenantId(), asset.getCustomerId()); - } else { - throw new RuntimeException("Asset with name '" + asset.getName() + "' is not assigned to Customer."); - } + return Futures.transformAsync(ctx.getAssetService().findAssetByIdAsync(ctx.getTenantId(), new AssetId(msg.getOriginator().getId())), asset -> { + if (asset != null) { + if (!asset.getCustomerId().isNullUid()) { + return ctx.getCustomerService().findCustomerByIdAsync(ctx.getTenantId(), asset.getCustomerId()); + } else { + throw new RuntimeException("Asset with name '" + asset.getName() + "' is not assigned to Customer."); + } + } else { + return Futures.immediateFuture(null); + } + }); case ENTITY_VIEW: - EntityView entityView = ctx.getEntityViewService().findEntityViewById(ctx.getTenantId(), new EntityViewId(msg.getOriginator().getId())); - if (!entityView.getCustomerId().isNullUid()) { - return ctx.getCustomerService().findCustomerById(ctx.getTenantId(), entityView.getCustomerId()); - } else { - throw new RuntimeException("EntityView with name '" + entityView.getName() + "' is not assigned to Customer."); - } + return Futures.transformAsync(ctx.getEntityViewService().findEntityViewByIdAsync(ctx.getTenantId(), new EntityViewId(msg.getOriginator().getId())), entityView -> { + if (entityView != null) { + if (!entityView.getCustomerId().isNullUid()) { + return ctx.getCustomerService().findCustomerByIdAsync(ctx.getTenantId(), entityView.getCustomerId()); + } else { + throw new RuntimeException("EntityView with name '" + entityView.getName() + "' is not assigned to Customer."); + } + } else { + return Futures.immediateFuture(null); + } + }); default: throw new RuntimeException("Entity with entityType '" + msg.getOriginator().getEntityType() + "' is not supported."); } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetTenantDetailsNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetTenantDetailsNode.java index 93b8f059f7..f029da29af 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetTenantDetailsNode.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetTenantDetailsNode.java @@ -15,17 +15,15 @@ */ package org.thingsboard.rule.engine.metadata; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; import lombok.extern.slf4j.Slf4j; import org.thingsboard.rule.engine.api.RuleNode; import org.thingsboard.rule.engine.api.TbContext; import org.thingsboard.rule.engine.api.TbNodeConfiguration; import org.thingsboard.rule.engine.api.TbNodeException; import org.thingsboard.rule.engine.api.util.TbNodeUtils; -import org.thingsboard.rule.engine.util.EntityDetails; import org.thingsboard.server.common.data.ContactBased; -import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.plugin.ComponentType; import org.thingsboard.server.common.msg.TbMsg; @@ -49,20 +47,18 @@ public class TbGetTenantDetailsNode extends TbAbstractGetEntityDetailsNode getDetails(TbContext ctx, TbMsg msg) { + return getTbMsgListenableFuture(ctx, msg, getDataAsJson(msg), TENANT_PREFIX); } - private TbMsg getTenantTbMsg(TbContext ctx, TbMsg msg, MessageData messageData) { - JsonElement resultObject = null; - Tenant tenant = ctx.getTenantService().findTenantById(ctx.getTenantId()); - if (!config.getDetailsList().isEmpty()) { - for (EntityDetails entityDetails : config.getDetailsList()) { - resultObject = addContactProperties(messageData.getData(), tenant, entityDetails, TENANT_PREFIX); + @Override + protected ListenableFuture getContactBasedListenableFuture(TbContext ctx, TbMsg msg) { + return Futures.transformAsync(ctx.getTenantService().findTenantByIdAsync(ctx.getTenantId(), ctx.getTenantId()), tenant -> { + if (tenant != null) { + return Futures.immediateFuture(tenant); + } else { + return Futures.immediateFuture(null); } - return transformMsg(ctx, msg, resultObject, messageData); - } else { - return msg; - } + }); } } From 1838ff91a6a398b7930c5a9b2faa887cce890c6b Mon Sep 17 00:00:00 2001 From: MengYue Guo <1953998+gemron@users.noreply.github.com> Date: Wed, 10 Apr 2019 21:48:09 +0800 Subject: [PATCH 16/20] Fix Chinese translation problem --- ui/src/app/locale/locale.constant-zh_CN.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/app/locale/locale.constant-zh_CN.json b/ui/src/app/locale/locale.constant-zh_CN.json index 836908de60..7697fa31a9 100644 --- a/ui/src/app/locale/locale.constant-zh_CN.json +++ b/ui/src/app/locale/locale.constant-zh_CN.json @@ -1442,7 +1442,7 @@ "Dec": "12月", "January": "一月", "February": "二月", - "March": "游行", + "March": "三月", "April": "四月", "June": "六月", "July": "七月", @@ -1472,7 +1472,7 @@ "6 months": "6个月", "Custom interval": "自定义间隔", "Interval": "间隔", - "Step size": "一步的大小", + "Step size": "步长", "Ok": "Ok" } } @@ -1509,4 +1509,4 @@ "uk_UA": "乌克兰" } } -} \ No newline at end of file +} From 02e7cea43ae45a4ecdaab183cb4a681ac2b06678 Mon Sep 17 00:00:00 2001 From: Sergey Tarnavskiy Date: Fri, 12 Apr 2019 13:20:06 +0300 Subject: [PATCH 17/20] Added custom-provider option for openStreet maps --- ui/package-lock.json | 28 +++++++------------------ ui/src/app/widget/lib/map-widget2.js | 25 +++++++++++++++++++--- ui/src/app/widget/lib/openstreet-map.js | 6 ++++-- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/ui/package-lock.json b/ui/package-lock.json index 84f64c627d..b683fef949 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -5239,14 +5239,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5261,20 +5259,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5391,8 +5386,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5404,7 +5398,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5419,7 +5412,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5427,14 +5419,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5453,7 +5443,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5534,8 +5523,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5547,7 +5535,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -5669,7 +5656,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/ui/src/app/widget/lib/map-widget2.js b/ui/src/app/widget/lib/map-widget2.js index f330bd61bf..a8a252e331 100644 --- a/ui/src/app/widget/lib/map-widget2.js +++ b/ui/src/app/widget/lib/map-widget2.js @@ -81,7 +81,14 @@ export default class TbMapWidgetV2 { if (mapProvider === 'google-map') { this.map = new TbGoogleMap($element, this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, minZoomLevel, settings.gmApiKey, settings.gmDefaultMapType); } else if (mapProvider === 'openstreet-map') { - this.map = new TbOpenStreetMap($element, this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, minZoomLevel, settings.mapProvider); + let openStreetMapProvider = {}; + if (settings.useCustomProvider && settings.customProviderTileUrl) { + openStreetMapProvider.name = settings.customProviderTileUrl; + openStreetMapProvider.isCustom = true; + } else { + openStreetMapProvider.name = settings.mapProvider; + } + this.map = new TbOpenStreetMap($element, this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, minZoomLevel, openStreetMapProvider); } else if (mapProvider === 'image-map') { this.map = new TbImageMap(this.ctx, $element, this.utils, initCallback, settings.mapImageUrl, @@ -800,7 +807,17 @@ const openstreetMapSettingsSchema = "title": "Map provider", "type": "string", "default": "OpenStreetMap.Mapnik" - } + }, + "useCustomProvider": { + "title": "Use custom provider", + "type": "boolean", + "default": false + }, + "customProviderTileUrl": { + "title": "Custom provider tile URL", + "type": "string", + "default": "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" + } }, "required": [] }, @@ -839,7 +856,9 @@ const openstreetMapSettingsSchema = "label": "CartoDB.DarkMatter" } ] - } + }, + "useCustomProvider", + "customProviderTileUrl" ] }; diff --git a/ui/src/app/widget/lib/openstreet-map.js b/ui/src/app/widget/lib/openstreet-map.js index 33f9ae09e2..a0c4d7a0a3 100644 --- a/ui/src/app/widget/lib/openstreet-map.js +++ b/ui/src/app/widget/lib/openstreet-map.js @@ -28,12 +28,14 @@ export default class TbOpenStreetMap { this.tooltips = []; if (!mapProvider) { - mapProvider = "OpenStreetMap.Mapnik"; + mapProvider = { + name: "OpenStreetMap.Mapnik" + }; } this.map = L.map($containerElement[0]).setView([0, 0], this.defaultZoomLevel || 8); - var tileLayer = L.tileLayer.provider(mapProvider); + var tileLayer = mapProvider.isCustom ? L.tileLayer(mapProvider.name) : L.tileLayer.provider(mapProvider.name); tileLayer.addTo(this.map); From 64ce9ba6e52557317eff516fd836701e40d19ad9 Mon Sep 17 00:00:00 2001 From: Maksym Dudnik Date: Mon, 15 Apr 2019 16:42:32 +0300 Subject: [PATCH 18/20] Trip animation widget improvement: -Added polygons -Included polygon tooltip functional(Standalone text) --- .../tripAnimation/trip-animation-widget.js | 1403 +++++++++-------- .../tripAnimation/trip-animation-widget.scss | 1 + .../trip-animation-widget.tpl.html | 2 +- ui/src/app/widget/lib/widget-utils.js | 2 +- 4 files changed, 762 insertions(+), 646 deletions(-) diff --git a/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.js b/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.js index e7dcad6299..6216802191 100644 --- a/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.js +++ b/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.js @@ -21,181 +21,181 @@ import tinycolor from "tinycolor2"; import {fillPatternWithActions, isNumber, padValue, processPattern} from "../widget-utils"; (function () { - // save these original methods before they are overwritten - var proto_initIcon = L.Marker.prototype._initIcon; - var proto_setPos = L.Marker.prototype._setPos; - - var oldIE = (L.DomUtil.TRANSFORM === 'msTransform'); - - L.Marker.addInitHook(function () { - var iconOptions = this.options.icon && this.options.icon.options; - var iconAnchor = iconOptions && this.options.icon.options.iconAnchor; - if (iconAnchor) { - iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px'); - } - this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom'; - this.options.rotationAngle = this.options.rotationAngle || 0; - - // Ensure marker keeps rotated during dragging - this.on('drag', function (e) { - e.target._applyRotation(); - }); - }); - - L.Marker.include({ - _initIcon: function () { - proto_initIcon.call(this); - }, - - _setPos: function (pos) { - proto_setPos.call(this, pos); - this._applyRotation(); - }, - - _applyRotation: function () { - if (this.options.rotationAngle) { - this._icon.style[L.DomUtil.TRANSFORM + 'Origin'] = this.options.rotationOrigin; - - if (oldIE) { - // for IE 9, use the 2D rotation - this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)'; - } else { - // for modern browsers, prefer the 3D accelerated version - let rotation = ' rotateZ(' + this.options.rotationAngle + 'deg)'; - if (!this._icon.style[L.DomUtil.TRANSFORM].includes(rotation)) { - this._icon.style[L.DomUtil.TRANSFORM] += rotation; - } - } - } - }, - - setRotationAngle: function (angle) { - this.options.rotationAngle = angle; - this.update(); - return this; - }, - - setRotationOrigin: function (origin) { - this.options.rotationOrigin = origin; - this.update(); - return this; - } - }); + // save these original methods before they are overwritten + var proto_initIcon = L.Marker.prototype._initIcon; + var proto_setPos = L.Marker.prototype._setPos; + + var oldIE = (L.DomUtil.TRANSFORM === 'msTransform'); + + L.Marker.addInitHook(function () { + var iconOptions = this.options.icon && this.options.icon.options; + var iconAnchor = iconOptions && this.options.icon.options.iconAnchor; + if (iconAnchor) { + iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px'); + } + this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom'; + this.options.rotationAngle = this.options.rotationAngle || 0; + + // Ensure marker keeps rotated during dragging + this.on('drag', function (e) { + e.target._applyRotation(); + }); + }); + + L.Marker.include({ + _initIcon: function () { + proto_initIcon.call(this); + }, + + _setPos: function (pos) { + proto_setPos.call(this, pos); + this._applyRotation(); + }, + + _applyRotation: function () { + if (this.options.rotationAngle) { + this._icon.style[L.DomUtil.TRANSFORM + 'Origin'] = this.options.rotationOrigin; + + if (oldIE) { + // for IE 9, use the 2D rotation + this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)'; + } else { + // for modern browsers, prefer the 3D accelerated version + let rotation = ' rotateZ(' + this.options.rotationAngle + 'deg)'; + if (!this._icon.style[L.DomUtil.TRANSFORM].includes(rotation)) { + this._icon.style[L.DomUtil.TRANSFORM] += rotation; + } + } + } + }, + + setRotationAngle: function (angle) { + this.options.rotationAngle = angle; + this.update(); + return this; + }, + + setRotationOrigin: function (origin) { + this.options.rotationOrigin = origin; + this.update(); + return this; + } + }); })(); export default angular.module('thingsboard.widgets.tripAnimation', []) - .directive('tripAnimation', tripAnimationWidget) - .filter('tripAnimation', function ($filter) { - return function (label) { - label = label.toString(); + .directive('tripAnimation', tripAnimationWidget) + .filter('tripAnimation', function ($filter) { + return function (label) { + label = label.toString(); - let translateSelector = "widgets.tripAnimation." + label; - let translation = $filter('translate')(translateSelector); + let translateSelector = "widgets.tripAnimation." + label; + let translation = $filter('translate')(translateSelector); - if (translation !== translateSelector) { - return translation; - } + if (translation !== translateSelector) { + return translation; + } - return label; - } - }) - .name; + return label; + } + }) + .name; /*@ngInject*/ function tripAnimationWidget() { - return { - restrict: "E", - scope: true, - bindToController: { - ctx: '=', - self: '=' - }, - controller: tripAnimationController, - controllerAs: 'vm', - templateUrl: template - }; + return { + restrict: "E", + scope: true, + bindToController: { + ctx: '=', + self: '=' + }, + controller: tripAnimationController, + controllerAs: 'vm', + templateUrl: template + }; } /*@ngInject*/ -function tripAnimationController($document, $scope, $http, $timeout, $filter, $sce) { - let vm = this; - - vm.initBounds = true; - - vm.markers = []; - vm.index = 0; - vm.dsIndex = 0; - vm.minTime = 0; - vm.maxTime = 0; - vm.isPlaying = false; - vm.trackingLine = { - "type": "FeatureCollection", - features: [] - }; - vm.speeds = [1, 5, 10, 25]; - vm.speed = 1; - vm.trips = []; - vm.activeTripIndex = 0; - - vm.showHideTooltip = showHideTooltip; - vm.recalculateTrips = recalculateTrips; - - $scope.$watch('vm.ctx', function () { - if (vm.ctx) { - vm.utils = vm.ctx.$scope.$injector.get('utils'); - vm.settings = vm.ctx.settings; - vm.widgetConfig = vm.ctx.widgetConfig; - vm.data = vm.ctx.data; - vm.datasources = vm.ctx.datasources; - configureStaticSettings(); - initialize(); - initializeCallbacks(); - } - }); - - - function initializeCallbacks() { - vm.self.onDataUpdated = function () { - createUpdatePath(true); - }; - - vm.self.onResize = function () { - resize(); - }; - - vm.self.typeParameters = function () { - return { - maxDatasources: 1, // Maximum allowed datasources for this widget, -1 - unlimited - maxDataKeys: -1 //Maximum allowed data keys for this widget, -1 - unlimited - } - }; - return true; - } - - - function resize() { - if (vm.map) { - vm.map.invalidateSize(); - } - } - - function initCallback() { - //createUpdatePath(); - //resize(); - } - - vm.playMove = function (play) { - if (play && vm.isPlaying) return; - if (play || vm.isPlaying) vm.isPlaying = true; - if (vm.isPlaying) { +function tripAnimationController($document, $scope, $log, $http, $timeout, $filter, $sce) { + let vm = this; + + vm.initBounds = true; + + vm.markers = []; + vm.index = 0; + vm.dsIndex = 0; + vm.minTime = 0; + vm.maxTime = 0; + vm.isPlaying = false; + vm.trackingLine = { + "type": "FeatureCollection", + features: [] + }; + vm.speeds = [1, 5, 10, 25]; + vm.speed = 1; + vm.trips = []; + vm.activeTripIndex = 0; + + vm.showHideTooltip = showHideTooltip; + vm.recalculateTrips = recalculateTrips; + + $scope.$watch('vm.ctx', function () { + if (vm.ctx) { + vm.utils = vm.ctx.$scope.$injector.get('utils'); + vm.settings = vm.ctx.settings; + vm.widgetConfig = vm.ctx.widgetConfig; + vm.data = vm.ctx.data; + vm.datasources = vm.ctx.datasources; + configureStaticSettings(); + initialize(); + initializeCallbacks(); + } + }); + + + function initializeCallbacks() { + vm.self.onDataUpdated = function () { + createUpdatePath(true); + }; + + vm.self.onResize = function () { + resize(); + }; + + vm.self.typeParameters = function () { + return { + maxDatasources: 1, // Maximum allowed datasources for this widget, -1 - unlimited + maxDataKeys: -1 //Maximum allowed data keys for this widget, -1 - unlimited + } + }; + return true; + } + + + function resize() { + if (vm.map) { + vm.map.invalidateSize(); + } + } + + function initCallback() { + //createUpdatePath(); + //resize(); + } + + vm.playMove = function (play) { + if (play && vm.isPlaying) return; + if (play || vm.isPlaying) vm.isPlaying = true; + if (vm.isPlaying) { moveInc(1); - vm.timeout = $timeout(function () { - vm.playMove(); - }, 1000 / vm.speed) - } - }; + vm.timeout = $timeout(function () { + vm.playMove(); + }, 1000 / vm.speed) + } + }; vm.moveNext = function () { vm.stopPlay(); @@ -217,12 +217,12 @@ function tripAnimationController($document, $scope, $http, $timeout, $filter, $s moveToIndex(vm.maxTime); } - vm.stopPlay = function () { + vm.stopPlay = function () { if (vm.isPlaying) { vm.isPlaying = false; $timeout.cancel(vm.timeout); } - }; + }; function moveInc(inc) { let newIndex = vm.index + inc; @@ -235,436 +235,504 @@ function tripAnimationController($document, $scope, $http, $timeout, $filter, $s recalculateTrips(); } - function recalculateTrips() { - vm.trips.forEach(function (value) { - moveMarker(value); - }) - } - - function findAngle(lat1, lng1, lat2, lng2) { - let angle = Math.atan2(0, 0) - Math.atan2(lat2 - lat1, lng2 - lng1); - angle = angle * 180 / Math.PI; - return parseInt(angle.toFixed(2)); - } - - function initialize() { - $scope.currentDate = $filter('date')(0, "yyyy.MM.dd HH:mm:ss"); - - vm.self.actionSources = [vm.searchAction]; - vm.endpoint = vm.ctx.settings.endpointUrl; - $scope.title = vm.ctx.widgetConfig.title; - vm.utils = vm.self.ctx.$scope.$injector.get('utils'); - - vm.showTimestamp = vm.settings.showTimestamp !== false; - vm.ctx.$element = angular.element("#trip-animation-map", vm.ctx.$container); - vm.defaultZoomLevel = 2; - if (vm.ctx.settings.defaultZoomLevel) { - if (vm.ctx.settings.defaultZoomLevel > 0 && vm.ctx.settings.defaultZoomLevel < 21) { - vm.defaultZoomLevel = Math.floor(vm.ctx.settings.defaultZoomLevel); - } - } - vm.dontFitMapBounds = vm.ctx.settings.fitMapBounds === false; - vm.map = new TbOpenStreetMap(vm.ctx.$element, vm.utils, initCallback, vm.defaultZoomLevel, vm.dontFitMapBounds, null, vm.staticSettings.mapProvider); - vm.map.bounds = vm.map.createBounds(); - vm.map.invalidateSize(true); - vm.map.bounds = vm.map.createBounds(); - - vm.tooltipActionsMap = {}; - var descriptors = vm.ctx.actionsApi.getActionDescriptors('tooltipAction'); - descriptors.forEach(function (descriptor) { - if (descriptor) vm.tooltipActionsMap[descriptor.name] = descriptor; - }); - } - - function configureStaticSettings() { - let staticSettings = {}; - vm.staticSettings = staticSettings; - //Calculate General Settings + function recalculateTrips() { + vm.trips.forEach(function (value) { + moveMarker(value); + }) + } + + function findAngle(lat1, lng1, lat2, lng2) { + let angle = Math.atan2(0, 0) - Math.atan2(lat2 - lat1, lng2 - lng1); + angle = angle * 180 / Math.PI; + return parseInt(angle.toFixed(2)); + } + + function initialize() { + $scope.currentDate = $filter('date')(0, "yyyy.MM.dd HH:mm:ss"); + + vm.self.actionSources = [vm.searchAction]; + vm.endpoint = vm.ctx.settings.endpointUrl; + $scope.title = vm.ctx.widgetConfig.title; + vm.utils = vm.self.ctx.$scope.$injector.get('utils'); + + vm.showTimestamp = vm.settings.showTimestamp !== false; + vm.ctx.$element = angular.element("#trip-animation-map", vm.ctx.$container); + vm.defaultZoomLevel = 2; + if (vm.ctx.settings.defaultZoomLevel) { + if (vm.ctx.settings.defaultZoomLevel > 0 && vm.ctx.settings.defaultZoomLevel < 21) { + vm.defaultZoomLevel = Math.floor(vm.ctx.settings.defaultZoomLevel); + } + } + vm.dontFitMapBounds = vm.ctx.settings.fitMapBounds === false; + vm.map = new TbOpenStreetMap(vm.ctx.$element, vm.utils, initCallback, vm.defaultZoomLevel, vm.dontFitMapBounds, null, vm.staticSettings.mapProvider); + vm.map.bounds = vm.map.createBounds(); + vm.map.invalidateSize(true); + vm.map.bounds = vm.map.createBounds(); + + vm.tooltipActionsMap = {}; + var descriptors = vm.ctx.actionsApi.getActionDescriptors('tooltipAction'); + descriptors.forEach(function (descriptor) { + if (descriptor) vm.tooltipActionsMap[descriptor.name] = descriptor; + }); + } + + function configureStaticSettings() { + let staticSettings = {}; + vm.staticSettings = staticSettings; + //Calculate General Settings staticSettings.buttonColor = tinycolor(vm.widgetConfig.color).setAlpha(0.54).toRgbString(); staticSettings.disabledButtonColor = tinycolor(vm.widgetConfig.color).setAlpha(0.3).toRgbString(); - staticSettings.mapProvider = vm.ctx.settings.mapProvider || "OpenStreetMap.Mapnik"; - staticSettings.latKeyName = vm.ctx.settings.latKeyName || "latitude"; - staticSettings.lngKeyName = vm.ctx.settings.lngKeyName || "longitude"; - staticSettings.rotationAngle = vm.ctx.settings.rotationAngle || 0; - staticSettings.displayTooltip = vm.ctx.settings.showTooltip || false; - staticSettings.defaultZoomLevel = vm.ctx.settings.defaultZoomLevel || true; - staticSettings.showTooltip = false; - staticSettings.label = vm.ctx.settings.label || "${entityName}"; - staticSettings.useLabelFunction = vm.ctx.settings.useLabelFunction || false; - staticSettings.showLabel = vm.ctx.settings.showLabel || false; - staticSettings.useTooltipFunction = vm.ctx.settings.useTooltipFunction || false; - staticSettings.tooltipPattern = vm.ctx.settings.tooltipPattern || "${entityName}\n" + + staticSettings.polygonColor = tinycolor(vm.ctx.settings.polygonColor).toHexString(); + staticSettings.polygonStrokeColor = tinycolor(vm.ctx.settings.polygonStrokeColor).toHexString(); + staticSettings.mapProvider = vm.ctx.settings.mapProvider || "OpenStreetMap.Mapnik"; + staticSettings.latKeyName = vm.ctx.settings.latKeyName || "latitude"; + staticSettings.lngKeyName = vm.ctx.settings.lngKeyName || "longitude"; + staticSettings.polKeyName = vm.ctx.settings.polKeyName || "coordinates"; + staticSettings.rotationAngle = vm.ctx.settings.rotationAngle || 0; + staticSettings.polygonOpacity = vm.ctx.settings.polygonOpacity || 0.5; + staticSettings.polygonStrokeOpacity = vm.ctx.settings.polygonStrokeOpacity || 1; + staticSettings.polygonStrokeWeight = vm.ctx.settings.polygonStrokeWeight || 1; + staticSettings.showPolygon = vm.ctx.settings.showPolygon || false; + staticSettings.usePolygonColorFunction = vm.ctx.settings.usePolygonColorFunction || false; + staticSettings.usePolygonTooltipFunction = vm.ctx.settings.usePolygonTooltipFunction || false; + staticSettings.displayTooltip = vm.ctx.settings.showTooltip || false; + staticSettings.defaultZoomLevel = vm.ctx.settings.defaultZoomLevel || true; + staticSettings.showTooltip = false; + staticSettings.label = vm.ctx.settings.label || "${entityName}"; + staticSettings.useLabelFunction = vm.ctx.settings.useLabelFunction || false; + staticSettings.showLabel = vm.ctx.settings.showLabel || false; + staticSettings.useTooltipFunction = vm.ctx.settings.useTooltipFunction || false; + staticSettings.tooltipPattern = vm.ctx.settings.tooltipPattern || "${entityName}\n" + "
\n" + "Time: ${formattedTs}\n" + "Latitude: ${latitude:7}\n" + "Longitude: ${longitude:7}"; - staticSettings.tooltipOpacity = angular.isNumber(vm.ctx.settings.tooltipOpacity) ? vm.ctx.settings.tooltipOpacity : 1; - staticSettings.tooltipColor = vm.ctx.settings.tooltipColor ? tinycolor(vm.ctx.settings.tooltipColor).toRgbString() : "#ffffff"; - staticSettings.tooltipFontColor = vm.ctx.settings.tooltipFontColor ? tinycolor(vm.ctx.settings.tooltipFontColor).toRgbString() : "#000000"; - staticSettings.pathColor = vm.ctx.settings.color ? tinycolor(vm.ctx.settings.color).toHexString() : "#ff6300"; - staticSettings.pathWeight = vm.ctx.settings.strokeWeight || 1; - staticSettings.pathOpacity = vm.ctx.settings.strokeOpacity || 1; - staticSettings.usePathColorFunction = vm.ctx.settings.useColorFunction || false; - staticSettings.showPoints = vm.ctx.settings.showPoints || false; - staticSettings.pointSize = vm.ctx.settings.pointSize || 1; - staticSettings.markerImageSize = vm.ctx.settings.markerImageSize || 20; - staticSettings.useMarkerImageFunction = vm.ctx.settings.useMarkerImageFunction || false; - staticSettings.pointColor = vm.ctx.settings.pointColor ? tinycolor(vm.ctx.settings.pointColor).toHexString() : "#ff6300"; - staticSettings.markerImages = vm.ctx.settings.markerImages || []; - staticSettings.icon = L.icon({ - iconUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqCAYAAAA9dtSCAAAAhnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjadY7LDcAwCEPvTNERCBA+40RVI3WDjl+iNMqp7wCWBZbheu4Ox6AggVRzDVVMJCSopXCcMGIhLGPnnHybSyraNjBNoeGGsg/l8xeV1bWbmGnVU0/KdLqY2HPmH4xUHDVih7S2Gv34q8ULVzos2Vmq5r4AAAoGaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA0LjQuMC1FeGl2MiI+CiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICBleGlmOlBpeGVsWERpbWVuc2lvbj0iMTcwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iMTcwIgogICB0aWZmOkltYWdlV2lkdGg9IjE3MCIKICAgdGlmZjpJbWFnZUhlaWdodD0iMTcwIgogICB0aWZmOk9yaWVudGF0aW9uPSIxIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7hlLlNAAAABHNCSVQICAgIfAhkiAAAIABJREFUeNrtnXmcXFWZ97/Pubeq1+wJSQghhHQ2FUFlFVdUlEXAAVFBQZh3cAy4ESGbCBHIQiTKxHUW4FVwGcAFFMRhkWEZfZkBZJQkTRASIGHJQpbequ49z/vHre7cqrpVXd1da3edz6c+XX1rv+d3f+f3/M5zniPUW87WulAnTnN5i8IBYpnsttKoSZoVpitMFssoIIbSqIILxFIvVVGsQjdCQoSEKvtweMkIrwh0+gm6fMtWA7s2XicP1s92/ib1U7C/TfmCThrXyvm+5TgnzgwRWtUyDksL0GJigIJq8LevaWFnWMz+YzYJCHsRusSwHej2etiA8HT7Klld7406UAFou1yPdVyOclxmWZ8TRDnMaQT1AQtqU4AsBIxFOPsigAnAbBzwulAV/kdiPGK7+RuWJzaukUfrQB0hbfYSXRlz+TDKAWo50LiIpoBZEjAOoWckBVybRMXwCg6bvSSPta+UhXWgDrM293I912niSJvgTLeJ6eoFrJk1fNdAT4mAOCAueF28JA6/tsp/bbxWbq0DtUbb/EV6tTRwuvWY5bg0q59izeHScSYArfXpFHjB8/hd++rhy7TDCqjzlupFOJxshNNFQL0aZM7BNAPGDS5Ea7kf5ZcbVsh360CtsjZniV7qOFyIMscYYtYbwdGxC+qhEuOvtosbN6yRb9WBWsE26/M6PT6Bi9VykRNnnCaH19BeDGlg4uD3sAfhRr+Lm9vXyp/rQC1ngLRElxuHCwSmo3WA5u3glO0FvOz73LZxpXylDtTSa9ArUL7gNDDJJkaA9ixyT5sY2CR71GXdhm/I1+pALXK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jgiuQhLFqtAp0IWwG9iH0iGGXeKwSYTtNkmPtWy1Pq88u0Yerp/x3O3/A6qXxURxUsm4AAAAAElFTkSuQmCC", - iconSize: [30, 30], - iconAnchor: [15, 15] - }); - if (angular.isDefined(vm.ctx.settings.markerImage)) { - staticSettings.icon = L.icon({ - iconUrl: vm.ctx.settings.markerImage, - iconSize: [staticSettings.markerImageSize, staticSettings.markerImageSize], - iconAnchor: [(staticSettings.markerImageSize / 2), (staticSettings.markerImageSize / 2)] - }) - } - - if (staticSettings.usePathColorFunction && angular.isDefined(vm.ctx.settings.colorFunction)) { - staticSettings.colorFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.colorFunction); - } - - if (staticSettings.useLabelFunction && angular.isDefined(vm.ctx.settings.labelFunction)) { - staticSettings.labelFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.labelFunction); - } - - if (staticSettings.useTooltipFunction && angular.isDefined(vm.ctx.settings.tooltipFunction)) { - staticSettings.tooltipFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.tooltipFunction); - } - - if (staticSettings.useMarkerImageFunction && angular.isDefined(vm.ctx.settings.markerImageFunction)) { - staticSettings.markerImageFunction = new Function('data, images, dsData, dsIndex', vm.ctx.settings.markerImageFunction); - } - - if (!staticSettings.useMarkerImageFunction && - angular.isDefined(vm.ctx.settings.markerImage) && - vm.ctx.settings.markerImage.length > 0) { - staticSettings.useMarkerImage = true; - let url = vm.ctx.settings.markerImage; - let size = staticSettings.markerImageSize || 20; - staticSettings.currentImage = { - url: url, - size: size - }; - vm.utils.loadImageAspect(staticSettings.currentImage.url).then( - (aspect) => { - if (aspect) { - let width; - let height; - if (aspect > 1) { - width = staticSettings.currentImage.size; - height = staticSettings.currentImage.size / aspect; - } else { - width = staticSettings.currentImage.size * aspect; - height = staticSettings.currentImage.size; - } - staticSettings.icon = L.icon({ - iconUrl: staticSettings.currentImage.url, - iconSize: [width, height], - iconAnchor: [width / 2, height / 2] - }); - } - if (vm.trips) { - vm.trips.forEach(function (trip) { - if (trip.marker) { - trip.marker.setIcon(staticSettings.icon); - } - }); - } - } - ) - } - } - - function configureTripSettings(trip, index, apply) { - trip.settings = {}; - trip.settings.color = calculateColor(trip); - trip.settings.strokeWeight = vm.staticSettings.pathWeight; - trip.settings.strokeOpacity = vm.staticSettings.pathOpacity; - trip.settings.pointColor = vm.staticSettings.pointColor; - trip.settings.pointSize = vm.staticSettings.pointSize; - trip.settings.icon = calculateIcon(trip); - if (apply) { + staticSettings.polygonTooltipPattern = vm.ctx.settings.polygonTooltipPattern || "${entityName}\n" + + "
\n" + + "Time: ${formattedTs}\n"; + staticSettings.tooltipOpacity = angular.isNumber(vm.ctx.settings.tooltipOpacity) ? vm.ctx.settings.tooltipOpacity : 1; + staticSettings.tooltipColor = vm.ctx.settings.tooltipColor ? tinycolor(vm.ctx.settings.tooltipColor).toRgbString() : "#ffffff"; + staticSettings.tooltipFontColor = vm.ctx.settings.tooltipFontColor ? tinycolor(vm.ctx.settings.tooltipFontColor).toRgbString() : "#000000"; + staticSettings.pathColor = vm.ctx.settings.color ? tinycolor(vm.ctx.settings.color).toHexString() : "#ff6300"; + staticSettings.pathWeight = vm.ctx.settings.strokeWeight || 1; + staticSettings.pathOpacity = vm.ctx.settings.strokeOpacity || 1; + staticSettings.usePathColorFunction = vm.ctx.settings.useColorFunction || false; + staticSettings.showPoints = vm.ctx.settings.showPoints || false; + staticSettings.pointSize = vm.ctx.settings.pointSize || 1; + staticSettings.markerImageSize = vm.ctx.settings.markerImageSize || 20; + staticSettings.useMarkerImageFunction = vm.ctx.settings.useMarkerImageFunction || false; + staticSettings.pointColor = vm.ctx.settings.pointColor ? tinycolor(vm.ctx.settings.pointColor).toHexString() : "#ff6300"; + staticSettings.markerImages = vm.ctx.settings.markerImages || []; + staticSettings.icon = L.icon({ + iconUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqCAYAAAA9dtSCAAAAhnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjadY7LDcAwCEPvTNERCBA+40RVI3WDjl+iNMqp7wCWBZbheu4Ox6AggVRzDVVMJCSopXCcMGIhLGPnnHybSyraNjBNoeGGsg/l8xeV1bWbmGnVU0/KdLqY2HPmH4xUHDVih7S2Gv34q8ULVzos2Vmq5r4AAAoGaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA0LjQuMC1FeGl2MiI+CiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICBleGlmOlBpeGVsWERpbWVuc2lvbj0iMTcwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iMTcwIgogICB0aWZmOkltYWdlV2lkdGg9IjE3MCIKICAgdGlmZjpJbWFnZUhlaWdodD0iMTcwIgogICB0aWZmOk9yaWVudGF0aW9uPSIxIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7hlLlNAAAABHNCSVQICAgIfAhkiAAAIABJREFUeNrtnXmcXFWZ97/Pubeq1+wJSQghhHQ2FUFlFVdUlEXAAVFBQZh3cAy4ESGbCBHIQiTKxHUW4FVwGcAFFMRhkWEZfZkBZJQkTRASIGHJQpbequ49z/vHre7cqrpVXd1da3edz6c+XX1rv+d3f+f3/M5zniPUW87WulAnTnN5i8IBYpnstt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wiDg3WqwN2wAANdiBBfW5KdnP9c9+Sv9bQ16+9Nm+Z3miEUxEmqV8HbEEMannDWh7ojnPu5uXSXYM/ozbbrK/qcfEGLgQuMA5OnWGze9a4QQkg9fmZ7/Oj9tVyTw3/nNpvc5fqdxzDqcAMgJHswfYu/VF40U9yX/tquXCYXHfDo02/XA9sjfE54GNOA4fZZAqwI4FlBYwTaFC/h3Yc/i2xj9/WkgYdMUBNcwm+otPcBtaJy9vVMkOcYQjaFDitD+LwgrU8Tg/f2PBN+cswvRaHb5t5qc5pbOIjwIeBE00cV72QNNDa66k+5uzGF5c7reWRnje44/nvyuZhPmiMnDZ7sX7MgQtNjNlqOdA4jFIF/MHv2FzSzknt3oeAeuwTl5d8j/We5Z+fWyW/G2Gx4Qhsp2rznLfw0VgDb7IeR6rleLeJMWqBwGfMvbVOCXsgbdNeB7wutiP8t+PwB7+LLRvWyE9HsIlRb72tbbH+o1jeEWvgbUCjWg5AaRZDS2qD2bTtHiHP5mahs5tZO79vJz4PrNJhDHsx7ETZ7Sd4Rg0PDWbnkDpQR2ibc7l+QAzjxXCQG8OxPgep5WCECWppQhiD0gK0oDQBjgiuQhLFqtAp0IWwG9iH0iGGXeKwSYTtNkmPtWy1Pq88u0Yerp/x3O3/A6qXxURxUsm4AAAAAElFTkSuQmCC", + iconSize: [30, 30], + iconAnchor: [15, 15] + }); + if (angular.isDefined(vm.ctx.settings.markerImage)) { + staticSettings.icon = L.icon({ + iconUrl: vm.ctx.settings.markerImage, + iconSize: [staticSettings.markerImageSize, staticSettings.markerImageSize], + iconAnchor: [(staticSettings.markerImageSize / 2), (staticSettings.markerImageSize / 2)] + }) + } + + if (staticSettings.usePathColorFunction && angular.isDefined(vm.ctx.settings.colorFunction)) { + staticSettings.colorFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.colorFunction); + } + + if (staticSettings.usePolygonTooltipFunction && angular.isDefined(vm.ctx.settings.polygonTooltipFunction)) { + staticSettings.polygonTooltipFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.polygonTooltipFunction); + } + + if (staticSettings.useLabelFunction && angular.isDefined(vm.ctx.settings.labelFunction)) { + staticSettings.labelFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.labelFunction); + } + + if (staticSettings.useTooltipFunction && angular.isDefined(vm.ctx.settings.tooltipFunction)) { + staticSettings.tooltipFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.tooltipFunction); + } + + if (staticSettings.usePolygonColorFunction && angular.isDefined(vm.ctx.settings.polygonColorFunction)) { + staticSettings.polygonColorFunction = new Function('data, dsData, dsIndex', vm.ctx.settings.polygonColorFunction); + } + + if (staticSettings.useMarkerImageFunction && angular.isDefined(vm.ctx.settings.markerImageFunction)) { + staticSettings.markerImageFunction = new Function('data, images, dsData, dsIndex', vm.ctx.settings.markerImageFunction); + } + + if (!staticSettings.useMarkerImageFunction && + angular.isDefined(vm.ctx.settings.markerImage) && + vm.ctx.settings.markerImage.length > 0) { + staticSettings.useMarkerImage = true; + let url = vm.ctx.settings.markerImage; + let size = staticSettings.markerImageSize || 20; + staticSettings.currentImage = { + url: url, + size: size + }; + vm.utils.loadImageAspect(staticSettings.currentImage.url).then( + (aspect) => { + if (aspect) { + let width; + let height; + if (aspect > 1) { + width = staticSettings.currentImage.size; + height = staticSettings.currentImage.size / aspect; + } else { + width = staticSettings.currentImage.size * aspect; + height = staticSettings.currentImage.size; + } + staticSettings.icon = L.icon({ + iconUrl: staticSettings.currentImage.url, + iconSize: [width, height], + iconAnchor: [width / 2, height / 2] + }); + } + if (vm.trips) { + vm.trips.forEach(function (trip) { + if (trip.marker) { + trip.marker.setIcon(staticSettings.icon); + } + }); + } + } + ) + } + } + + function configureTripSettings(trip, index, apply) { + trip.settings = {}; + trip.settings.color = calculateColor(trip); + trip.settings.polygonColor = calculatePolygonColor(trip); + trip.settings.strokeWeight = vm.staticSettings.pathWeight; + trip.settings.strokeOpacity = vm.staticSettings.pathOpacity; + trip.settings.pointColor = vm.staticSettings.pointColor; + trip.settings.polygonStrokeColor = vm.staticSettings.polygonStrokeColor; + trip.settings.polygonStrokeOpacity = vm.staticSettings.polygonStrokeOpacity; + trip.settings.polygonOpacity = vm.staticSettings.polygonOpacity; + trip.settings.polygonStrokeWeight = vm.staticSettings.polygonStrokeWeight; + trip.settings.pointSize = vm.staticSettings.pointSize; + trip.settings.icon = calculateIcon(trip); + if (apply) { $timeout(() => { trip.settings.labelText = calculateLabel(trip); trip.settings.tooltipText = $sce.trustAsHtml(calculateTooltip(trip)); - },0,true); + trip.settings.polygonTooltipText = $sce.trustAsHtml(calculatePolygonTooltip(trip)); + }, 0, true); } else { trip.settings.labelText = calculateLabel(trip); trip.settings.tooltipText = $sce.trustAsHtml(calculateTooltip(trip)); + trip.settings.polygonTooltipText = $sce.trustAsHtml(calculatePolygonTooltip(trip)); + } + } + + function calculateLabel(trip) { + let label = ''; + if (vm.staticSettings.showLabel) { + let labelReplaceInfo; + let labelText = vm.staticSettings.label; + if (vm.staticSettings.useLabelFunction && angular.isDefined(vm.staticSettings.labelFunction)) { + try { + labelText = vm.staticSettings.labelFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dsIndex); + } catch (e) { + labelText = null; + } + } + labelText = vm.utils.createLabelFromDatasource(trip.dataSource, labelText); + labelReplaceInfo = processPattern(labelText, vm.ctx.datasources, trip.dSIndex); + label = fillPattern(labelText, labelReplaceInfo, trip.timeRange[vm.index]); + if (vm.staticSettings.useLabelFunction && angular.isDefined(vm.staticSettings.labelFunction)) { + try { + labelText = vm.staticSettings.labelFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); + } catch (e) { + labelText = null; + } + } } - } - - function calculateLabel(trip) { - let label = ''; - if (vm.staticSettings.showLabel) { - let labelReplaceInfo; - let labelText = vm.staticSettings.label; - if (vm.staticSettings.useLabelFunction && angular.isDefined(vm.staticSettings.labelFunction)) { - try { - labelText = vm.staticSettings.labelFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dsIndex); - } catch (e) { - labelText = null; - } - } - labelText = vm.utils.createLabelFromDatasource(trip.dataSource, labelText); - labelReplaceInfo = processPattern(labelText, vm.ctx.datasources, trip.dSIndex); - label = fillPattern(labelText, labelReplaceInfo, trip.timeRange[vm.index]); - if (vm.staticSettings.useLabelFunction && angular.isDefined(vm.staticSettings.labelFunction)) { - try { - labelText = vm.staticSettings.labelFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); - } catch (e) { - labelText = null; - } - } - } - return label; - } - - function calculateTooltip(trip) { - let tooltip = ''; - if (vm.staticSettings.displayTooltip) { - let tooltipReplaceInfo; - let tooltipText = vm.staticSettings.tooltipPattern; - if (vm.staticSettings.useTooltipFunction && angular.isDefined(vm.staticSettings.tooltipFunction)) { - try { - tooltipText = vm.staticSettings.tooltipFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); - } catch (e) { - tooltipText = null; - } - } - tooltipText = vm.utils.createLabelFromDatasource(trip.dataSource, tooltipText); - tooltipReplaceInfo = processPattern(tooltipText, vm.ctx.datasources, trip.dSIndex); - tooltip = fillPattern(tooltipText, tooltipReplaceInfo, trip.timeRange[vm.index]); - tooltip = fillPatternWithActions(tooltip, 'onTooltipAction', null); - - } - return tooltip; - } - - function calculateColor(trip) { - let color = vm.staticSettings.pathColor; - let colorFn; - if (vm.staticSettings.usePathColorFunction && angular.isDefined(vm.staticSettings.colorFunction)) { - try { - colorFn = vm.staticSettings.colorFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); - } catch (e) { - colorFn = null; - } - } - if (colorFn && colorFn !== color && trip.polyline) { - trip.polyline.setStyle({color: colorFn}); - } - return colorFn || color; - } - - function calculateIcon(trip) { - let icon = vm.staticSettings.icon; - if (vm.staticSettings.useMarkerImageFunction && angular.isDefined(vm.staticSettings.markerImageFunction)) { - let rawIcon; - try { - rawIcon = vm.staticSettings.markerImageFunction(vm.ctx.data, vm.staticSettings.markerImages, trip.timeRange[vm.index], trip.dSIndex); - } catch (e) { - rawIcon = null; - } - if (rawIcon) { - vm.utils.loadImageAspect(rawIcon).then( - (aspect) => { - if (aspect) { - let width; - let height; - if (aspect > 1) { - width = rawIcon.size; - height = rawIcon.size / aspect; - } else { - width = rawIcon.size * aspect; - height = rawIcon.size; - } - icon = L.icon({ - iconUrl: rawIcon, - iconSize: [width, height], - iconAnchor: [width / 2, height / 2] - }); - } - if (trip.marker) { - trip.marker.setIcon(icon); - } - } - ) - } - } - return icon; - } - - function createUpdatePath(apply) { - if (vm.trips && vm.map) { - vm.trips.forEach(function (trip) { - if (trip.marker) { - trip.marker.remove(); - delete trip.marker; - } - if (trip.polyline) { - trip.polyline.remove(); - delete trip.polyline; - } - if (trip.points && trip.points.length) { - trip.points.forEach(function (point) { - point.remove(); - }); - delete trip.points; - } - }); - vm.initBounds = true; - } - let normalizedTimeRange = createNormalizedTime(vm.data, 1000); - createNormalizedTrips(normalizedTimeRange, vm.datasources); - createTripsOnMap(apply); - if (vm.initBounds && !vm.initTrips) { - vm.trips.forEach(function (trip) { - vm.map.extendBounds(vm.map.bounds, trip.polyline); - vm.initBounds = !vm.datasources.every( - function (ds) { - return ds.dataReceived === true; - }); - vm.initTrips = vm.trips.every(function (trip) { - return angular.isDefined(trip.marker) && angular.isDefined(trip.polyline); - }); - }); - - vm.map.fitBounds(vm.map.bounds); - } - } - - function fillPattern(pattern, replaceInfo, currentNormalizedValue) { - let text = angular.copy(pattern); - let reg = /\$\{([^\}]*)\}/g; - if (replaceInfo) { - for (let v = 0; v < replaceInfo.variables.length; v++) { - let variableInfo = replaceInfo.variables[v]; - let label = reg.exec(pattern)[1].split(":")[0]; - let txtVal = ''; - if (label.length > -1 && angular.isDefined(currentNormalizedValue[label])) { - let varData = currentNormalizedValue[label]; - if (isNumber(varData)) { - txtVal = padValue(varData, variableInfo.valDec, 0); - } else { - txtVal = varData; - } - } - text = text.split(variableInfo.variable).join(txtVal); - } - } - return text; - } - - function createNormalizedTime(data, step) { - if (!step) step = 1000; - let max_time = null; - let min_time = null; - let normalizedArray = []; - if (data && data.length > 0) { - vm.data.forEach(function (data) { - if (data.data.length > 0) { - data.data.forEach(function (sData) { - if (max_time === null) { - max_time = sData[0]; - } else if (max_time < sData[0]) { - max_time = sData[0] - } - if (min_time === null) { - min_time = sData[0]; - } else if (min_time > sData[0]) { - min_time = sData[0]; - } - }) - } - }); - for (let i = min_time; i < max_time; i += step) { - normalizedArray.push({ts: i, formattedTs: $filter('date')(i, 'medium')}); - - } - if (normalizedArray[normalizedArray.length - 1] && normalizedArray[normalizedArray.length - 1].ts !== max_time) { + return label; + } + + function calculateTooltip(trip) { + let tooltip = ''; + if (vm.staticSettings.displayTooltip) { + let tooltipReplaceInfo; + let tooltipText = vm.staticSettings.tooltipPattern; + if (vm.staticSettings.useTooltipFunction && angular.isDefined(vm.staticSettings.tooltipFunction)) { + try { + tooltipText = vm.staticSettings.tooltipFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); + } catch (e) { + tooltipText = null; + } + } + tooltipText = vm.utils.createLabelFromDatasource(trip.dataSource, tooltipText); + tooltipReplaceInfo = processPattern(tooltipText, vm.ctx.datasources, trip.dSIndex); + tooltip = fillPattern(tooltipText, tooltipReplaceInfo, trip.timeRange[vm.index]); + tooltip = fillPatternWithActions(tooltip, 'onTooltipAction', null); + + } + return tooltip; + } + + function calculatePolygonTooltip(trip) { + let tooltip = ''; + if (vm.staticSettings.displayTooltip) { + let tooltipReplaceInfo; + let tooltipText = vm.staticSettings.polygonTooltipPattern; + if (vm.staticSettings.usePolygonTooltipFunction && angular.isDefined(vm.staticSettings.polygonTooltipFunction)) { + try { + tooltipText = vm.staticSettings.polygonTooltipFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); + } catch (e) { + tooltipText = null; + } + } + tooltipText = vm.utils.createLabelFromDatasource(trip.dataSource, tooltipText); + tooltipReplaceInfo = processPattern(tooltipText, vm.ctx.datasources, trip.dSIndex); + tooltip = fillPattern(tooltipText, tooltipReplaceInfo, trip.timeRange[vm.index]); + tooltip = fillPatternWithActions(tooltip, 'onTooltipAction', null); + + } + return tooltip; + } + + function calculateColor(trip) { + let color = vm.staticSettings.pathColor; + let colorFn; + if (vm.staticSettings.usePathColorFunction && angular.isDefined(vm.staticSettings.colorFunction)) { + try { + colorFn = vm.staticSettings.colorFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); + } catch (e) { + colorFn = null; + } + } + if (colorFn && colorFn !== color && trip.polyline) { + trip.polyline.setStyle({color: colorFn}); + } + return colorFn || color; + } + + function calculatePolygonColor(trip) { + let color = vm.staticSettings.polygonColor; + let colorFn; + if (vm.staticSettings.usePolygonColorFunction && angular.isDefined(vm.staticSettings.polygonColorFunction)) { + try { + colorFn = vm.staticSettings.polygonColorFunction(vm.ctx.data, trip.timeRange[vm.index], trip.dSIndex); + } catch (e) { + colorFn = null; + } + } + if (colorFn && colorFn !== color && trip.polygon) { + trip.polygon.setStyle({fillColor: colorFn}); + } + return colorFn || color; + } + + function calculateIcon(trip) { + let icon = vm.staticSettings.icon; + if (vm.staticSettings.useMarkerImageFunction && angular.isDefined(vm.staticSettings.markerImageFunction)) { + let rawIcon; + try { + rawIcon = vm.staticSettings.markerImageFunction(vm.ctx.data, vm.staticSettings.markerImages, trip.timeRange[vm.index], trip.dSIndex); + } catch (e) { + rawIcon = null; + } + if (rawIcon) { + vm.utils.loadImageAspect(rawIcon).then( + (aspect) => { + if (aspect) { + let width; + let height; + if (aspect > 1) { + width = rawIcon.size; + height = rawIcon.size / aspect; + } else { + width = rawIcon.size * aspect; + height = rawIcon.size; + } + icon = L.icon({ + iconUrl: rawIcon, + iconSize: [width, height], + iconAnchor: [width / 2, height / 2] + }); + } + if (trip.marker) { + trip.marker.setIcon(icon); + } + } + ) + } + } + return icon; + } + + function createUpdatePath(apply) { + if (vm.trips && vm.map) { + vm.trips.forEach(function (trip) { + if (trip.marker) { + trip.marker.remove(); + delete trip.marker; + } + if (trip.polyline) { + trip.polyline.remove(); + delete trip.polyline; + } + if (trip.polygon) { + trip.polygon.remove(); + delete trip.polygon; + } + if (trip.points && trip.points.length) { + trip.points.forEach(function (point) { + point.remove(); + }); + delete trip.points; + } + }); + vm.initBounds = true; + } + let normalizedTimeRange = createNormalizedTime(vm.data, 1000); + createNormalizedTrips(normalizedTimeRange, vm.datasources); + createTripsOnMap(apply); + if (vm.initBounds && !vm.initTrips) { + vm.trips.forEach(function (trip) { + vm.map.extendBounds(vm.map.bounds, trip.polyline); + vm.initBounds = !vm.datasources.every( + function (ds) { + return ds.dataReceived === true; + }); + vm.initTrips = vm.trips.every(function (trip) { + return angular.isDefined(trip.marker) && angular.isDefined(trip.polyline); + }); + }); + + vm.map.fitBounds(vm.map.bounds); + } + } + + function fillPattern(pattern, replaceInfo, currentNormalizedValue) { + let text = angular.copy(pattern); + let reg = /\$\{([^\}]*)\}/g; + if (replaceInfo) { + for (let v = 0; v < replaceInfo.variables.length; v++) { + let variableInfo = replaceInfo.variables[v]; + let label = reg.exec(pattern)[1].split(":")[0]; + let txtVal = ''; + if (label.length > -1 && angular.isDefined(currentNormalizedValue[label])) { + let varData = currentNormalizedValue[label]; + if (isNumber(varData)) { + txtVal = padValue(varData, variableInfo.valDec, 0); + } else { + txtVal = varData; + } + } + text = text.split(variableInfo.variable).join(txtVal); + } + } + return text; + } + + function createNormalizedTime(data, step) { + if (!step) step = 1000; + let max_time = null; + let min_time = null; + let normalizedArray = []; + if (data && data.length > 0) { + vm.data.forEach(function (data) { + if (data.data.length > 0) { + data.data.forEach(function (sData) { + if (max_time === null) { + max_time = sData[0]; + } else if (max_time < sData[0]) { + max_time = sData[0] + } + if (min_time === null) { + min_time = sData[0]; + } else if (min_time > sData[0]) { + min_time = sData[0]; + } + }) + } + }); + for (let i = min_time; i < max_time; i += step) { + normalizedArray.push({ts: i, formattedTs: $filter('date')(i, 'medium')}); + + } + if (normalizedArray[normalizedArray.length - 1] && normalizedArray[normalizedArray.length - 1].ts !== max_time) { normalizedArray.push({ts: max_time, formattedTs: $filter('date')(max_time, 'medium')}); } - } - vm.maxTime = normalizedArray.length - 1; - vm.minTime = vm.maxTime > 1 ? 1 : 0; - if (vm.index < vm.minTime) { + } + vm.maxTime = normalizedArray.length - 1; + vm.minTime = vm.maxTime > 1 ? 1 : 0; + if (vm.index < vm.minTime) { vm.index = vm.minTime; } else if (vm.index > vm.maxTime) { vm.index = vm.maxTime; } - return normalizedArray; - } - - function createNormalizedTrips(timeRange, dataSources) { - vm.trips = []; - if (timeRange && timeRange.length > 0 && dataSources && dataSources.length > 0 && vm.data && vm.data.length > 0) { - dataSources.forEach(function (dS, index) { - vm.trips.push({ - dataSource: dS, - dSIndex: index, - timeRange: angular.copy(timeRange) - }) - }); - - vm.data.forEach(function (data) { - let ds = data.datasource; - let tripIndex = vm.trips.findIndex(function (el) { - return el.dataSource.entityId === ds.entityId; - }); - - if (tripIndex > -1) { - createNormalizedValue(data.data, data.dataKey.label, vm.trips[tripIndex].timeRange); - } - }) - } - - createNormalizedLatLngs(); - } - - function createNormalizedValue(dataArray, dataKey, timeRangeArray) { - timeRangeArray.forEach(function (timeStamp) { - let targetTDiff = null; - let value = null; - for (let i = 0; i < dataArray.length; i++) { - let tDiff = dataArray[i][0] - timeStamp.ts; - if (targetTDiff === null || (tDiff <= 0 && targetTDiff < tDiff)) { - targetTDiff = tDiff; - value = dataArray[i][1]; - - } - } - if (value !== null) timeStamp[dataKey] = value; - }); - } - - function createNormalizedLatLngs() { - vm.trips.forEach(function (el) { - el.latLngs = []; - el.timeRange.forEach(function (data) { - let lat = data[vm.staticSettings.latKeyName]; - let lng = data[vm.staticSettings.lngKeyName]; - if (lat && lng && vm.map) { - data.latLng = vm.map.createLatLng(lat, lng); - } - el.latLngs.push(data.latLng); - }); - addAngleForTrip(el); - }) - } - - function addAngleForTrip(trip) { - if (trip.timeRange && trip.timeRange.length > 0) { - trip.timeRange.forEach(function (point, index) { - let nextPoint, prevPoint; - nextPoint = index === (trip.timeRange.length - 1) ? trip.timeRange[index] : trip.timeRange[index + 1]; - prevPoint = index === 0 ? trip.timeRange[0] : trip.timeRange[index - 1]; - let nextLatLng = { + return normalizedArray; + } + + function createNormalizedTrips(timeRange, dataSources) { + vm.trips = []; + if (timeRange && timeRange.length > 0 && dataSources && dataSources.length > 0 && vm.data && vm.data.length > 0) { + dataSources.forEach(function (dS, index) { + vm.trips.push({ + dataSource: dS, + dSIndex: index, + timeRange: angular.copy(timeRange) + }) + }); + + vm.data.forEach(function (data) { + let ds = data.datasource; + let tripIndex = vm.trips.findIndex(function (el) { + return el.dataSource.entityId === ds.entityId; + }); + + if (tripIndex > -1) { + createNormalizedValue(data.data, data.dataKey.label, vm.trips[tripIndex].timeRange); + } + }) + } + + createNormalizedLatLngs(); + } + + function createNormalizedValue(dataArray, dataKey, timeRangeArray) { + timeRangeArray.forEach(function (timeStamp) { + let targetTDiff = null; + let value = null; + for (let i = 0; i < dataArray.length; i++) { + let tDiff = dataArray[i][0] - timeStamp.ts; + if (targetTDiff === null || (tDiff <= 0 && targetTDiff < tDiff)) { + targetTDiff = tDiff; + value = dataArray[i][1]; + + } + } + if (value !== null) timeStamp[dataKey] = value; + }); + } + + function createNormalizedLatLngs() { + vm.trips.forEach(function (el) { + el.latLngs = []; + el.timeRange.forEach(function (data) { + let lat = data[vm.staticSettings.latKeyName]; + let lng = data[vm.staticSettings.lngKeyName]; + if (lat && lng && vm.map) { + data.latLng = vm.map.createLatLng(lat, lng); + } + el.latLngs.push(data.latLng); + }); + addAngleForTrip(el); + }) + } + + function addAngleForTrip(trip) { + if (trip.timeRange && trip.timeRange.length > 0) { + trip.timeRange.forEach(function (point, index) { + let nextPoint, prevPoint; + nextPoint = index === (trip.timeRange.length - 1) ? trip.timeRange[index] : trip.timeRange[index + 1]; + prevPoint = index === 0 ? trip.timeRange[0] : trip.timeRange[index - 1]; + let nextLatLng = { lat: nextPoint[vm.staticSettings.latKeyName], lng: nextPoint[vm.staticSettings.lngKeyName] }; @@ -682,78 +750,125 @@ function tripAnimationController($document, $scope, $http, $timeout, $filter, $s point.h = findAngle(prevLatLng.lat, prevLatLng.lng, nextLatLng.lat, nextLatLng.lng); point.h += vm.staticSettings.rotationAngle; } - }); - } - } - - function createTripsOnMap(apply) { - if (vm.trips.length > 0) { - vm.trips.forEach(function (trip) { - if (trip.timeRange.length > 0 && trip.latLngs.every(el => angular.isDefined(el))) { - configureTripSettings(trip, vm.index, apply); - if (vm.staticSettings.showPoints) { - trip.points = []; - trip.latLngs.forEach(function (latLng) { - let point = L.circleMarker(latLng, { - color: trip.settings.pointColor, - radius: trip.settings.pointSize - }).addTo(vm.map.map); - trip.points.push(point); - }); - } - - if (angular.isUndefined(trip.marker)) { - trip.polyline = vm.map.createPolyline(trip.latLngs, trip.settings); - } - - if (trip.timeRange && trip.timeRange.length && angular.isUndefined(trip.marker)) { - trip.marker = L.marker(trip.timeRange[vm.index].latLng); - trip.marker.setZIndexOffset(1000); - trip.marker.setIcon(vm.staticSettings.icon); - trip.marker.setRotationOrigin('center center'); + }); + } + } + + function createTripsOnMap(apply) { + if (vm.trips.length > 0) { + vm.trips.forEach(function (trip) { + configureTripSettings(trip, vm.index, apply); + if (trip.timeRange.length > 0 && trip.latLngs.every(el => angular.isDefined(el))) { + if (vm.staticSettings.showPoints) { + trip.points = []; + trip.latLngs.forEach(function (latLng) { + let point = L.circleMarker(latLng, { + color: trip.settings.pointColor, + radius: trip.settings.pointSize + }).addTo(vm.map.map); + trip.points.push(point); + }); + } + + if (angular.isUndefined(trip.marker)) { + trip.polyline = vm.map.createPolyline(trip.latLngs, trip.settings); + } + + + if (trip.timeRange && trip.timeRange.length && angular.isUndefined(trip.marker)) { + trip.marker = L.marker(trip.timeRange[vm.index].latLng); + trip.marker.setZIndexOffset(1000); + trip.marker.setIcon(vm.staticSettings.icon); + trip.marker.setRotationOrigin('center center'); trip.marker.on('click', function () { showHideTooltip(trip); }); - trip.marker.addTo(vm.map.map); - moveMarker(trip); - } - } - }); - } - } - - function moveMarker(trip) { - if (angular.isDefined(trip.marker)) { - trip.markerAngleIsSet = true; - trip.marker.setLatLng(trip.timeRange[vm.index].latLng); - trip.marker.setRotationAngle(trip.timeRange[vm.index].h); - trip.marker.update(); - } else { - if (trip.timeRange && trip.timeRange.length) { - trip.marker = L.marker(trip.timeRange[vm.index].latLng); - trip.marker.setZIndexOffset(1000); - trip.marker.setIcon(vm.staticSettings.icon); - trip.marker.setRotationOrigin('center center'); - trip.marker.on('click', function () { - showHideTooltip(trip); - }); - trip.marker.addTo(vm.map.map); - trip.marker.update(); - } - - } - configureTripSettings(trip); - } - - - function showHideTooltip(trip) { - if (vm.staticSettings.displayTooltip) { - if (vm.staticSettings.showTooltip && trip && vm.activeTripIndex !== trip.dSIndex) { - vm.staticSettings.showTooltip = true; - } else { - vm.staticSettings.showTooltip = !vm.staticSettings.showTooltip; - } - } - if (trip && vm.activeTripIndex !== trip.dSIndex) vm.activeTripIndex = trip.dSIndex; - } + trip.marker.addTo(vm.map.map); + moveMarker(trip); + } + } + + if (vm.staticSettings.showPolygon && angular.isDefined(trip.timeRange[vm.index][vm.staticSettings.polKeyName])) { + let polygonSettings = { + fill: true, + fillColor: trip.settings.polygonColor, + color: trip.settings.polygonStrokeColor, + weight: trip.settings.polygonStrokeWeight, + fillOpacity: trip.settings.polygonOpacity, + opacity: trip.settings.polygonStrokeOpacity + }; + let polygonLatLngsRaw = mapPolygonArray(angular.fromJson(trip.timeRange[vm.index][vm.staticSettings.polKeyName])); + trip.polygon = L.polygon(polygonLatLngsRaw, polygonSettings).addTo(vm.map.map); + trip.polygon.on('click',function(){showHidePolygonTooltip(trip)}); + } + }); + } + } + + function mapPolygonArray(rawArray) { + return rawArray.map(function (el) { + if (el.length === 2) { + if (!angular.isNumber(el[0]) && !angular.isNumber(el[1])) { + return el.map(function (subEl) { + return mapPolygonArray(subEl); + }) + } else { + return vm.map.createLatLng(el[0], el[1]); + } + } else if (el.length > 2) { + return mapPolygonArray(el); + } else { + return vm.map.createLatLng(false); + } + }); + } + + function moveMarker(trip) { + if (angular.isDefined(trip.timeRange[vm.index].latLng)) { + if (angular.isDefined(trip.marker)) { + trip.markerAngleIsSet = true; + trip.marker.setLatLng(trip.timeRange[vm.index].latLng); + trip.marker.setRotationAngle(trip.timeRange[vm.index].h); + trip.marker.update(); + } else { + if (trip.timeRange && trip.timeRange.length) { + trip.marker = L.marker(trip.timeRange[vm.index].latLng); + trip.marker.setZIndexOffset(1000); + trip.marker.setIcon(vm.staticSettings.icon); + trip.marker.setRotationOrigin('center center'); + trip.marker.on('click', function () { + showHideTooltip(trip); + }); + trip.marker.addTo(vm.map.map); + trip.marker.update(); + } + } + } + configureTripSettings(trip); + } + + + function showHideTooltip(trip) { + if (vm.staticSettings.displayTooltip) { + if (vm.staticSettings.showTooltip && trip && (vm.activeTripIndex !== trip.dSIndex || vm.staticSettings.tooltipMarker !== 'marker')) { + vm.staticSettings.showTooltip = true; + } else { + vm.staticSettings.showTooltip = !vm.staticSettings.showTooltip; + } + vm.staticSettings.tooltipMarker = 'marker'; + } + if (trip && vm.activeTripIndex !== trip.dSIndex) vm.activeTripIndex = trip.dSIndex; + } + + function showHidePolygonTooltip(trip) { + if (vm.staticSettings.displayTooltip) { + if (vm.staticSettings.showTooltip && trip && (vm.activeTripIndex !== trip.dSIndex || vm.staticSettings.tooltipMarker !== 'polygon')) { + vm.staticSettings.showTooltip = true; + } else { + vm.staticSettings.showTooltip = !vm.staticSettings.showTooltip; + } + vm.staticSettings.tooltipMarker = 'polygon'; + } + if (trip && vm.activeTripIndex !== trip.dSIndex) vm.activeTripIndex = trip.dSIndex; + } } \ No newline at end of file diff --git a/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.scss b/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.scss index b4616214fc..f3c33fce33 100644 --- a/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.scss +++ b/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.scss @@ -91,6 +91,7 @@ position: relative; box-sizing: border-box; width: 100%; + padding-bottom: 16px; padding-left: 10px; md-slider-container { diff --git a/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.tpl.html b/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.tpl.html index 498ca5cb71..ce2b051980 100644 --- a/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.tpl.html +++ b/ui/src/app/widget/lib/tripAnimation/trip-animation-widget.tpl.html @@ -27,7 +27,7 @@ -
diff --git a/ui/src/app/widget/lib/widget-utils.js b/ui/src/app/widget/lib/widget-utils.js index 36bc6565e8..70648723b8 100644 --- a/ui/src/app/widget/lib/widget-utils.js +++ b/ui/src/app/widget/lib/widget-utils.js @@ -210,7 +210,7 @@ export function arraysEqual(a, b) { if (a.length != b.length) return false; for (var i = 0; i < a.length; ++i) { - if (!a[i].equals(b[i])) return false; + if (!arraysEqual(a[i],b[i])) return false; } return true; } From f0d770fadfd14c4431ab65047ff521f61bd48eb9 Mon Sep 17 00:00:00 2001 From: Maksym Dudnik Date: Mon, 15 Apr 2019 17:27:43 +0300 Subject: [PATCH 19/20] maps widget bundle changes (trip_animation configs) --- .../src/main/data/json/system/widget_bundles/maps.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/src/main/data/json/system/widget_bundles/maps.json b/application/src/main/data/json/system/widget_bundles/maps.json index 66c87e1536..b2bb6eb1af 100644 --- a/application/src/main/data/json/system/widget_bundles/maps.json +++ b/application/src/main/data/json/system/widget_bundles/maps.json @@ -122,15 +122,15 @@ "name": "Trip Animation", "descriptor": { "type": "timeseries", - "sizeX": 8.5, + "sizeX": 10, "sizeY": 6.5, "resources": [], "templateHtml": "", "templateCss": ".legend {\n font-size: 13px;\n line-height: 10px;\n}\n\n.legend table { \n border-spacing: 0px;\n border-collapse: separate;\n}\n\n.mouse-events .flot-overlay {\n cursor: crosshair; \n}\n\n", "controllerScript": " self.onInit = function() {\n var $scope = self.ctx.$scope;\n $scope.self = self;\n }\n \n \n self.actionSources = function () {\n return {\n 'tooltipAction': {\n name: 'widget-action.tooltip-tag-action',\n multiple: false\n }\n }\n };\n", - "settingsSchema": "{\r\n \"schema\": {\r\n \"title\": \"Openstreet Map Configuration\",\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"mapProvider\": {\r\n \"title\": \"Map provider\",\r\n \"type\": \"string\",\r\n \"default\": \"OpenStreetMap.Mapnik\"\r\n },\r\n \"defaultZoomLevel\": {\r\n\t\t\t\t\t\"title\": \"Default map zoom level (1 - 20)\",\r\n\t\t\t\t\t\"type\": \"number\"\r\n\t\t\t\t},\r\n\t\t\t\"fitMapBounds\": {\r\n\t\t\t\t\"title\": \"Fit map bounds to cover all markers\",\r\n\t\t\t\t\"type\": \"boolean\",\r\n\t\t\t\t\"default\": true\r\n\t\t\t},\r\n \"latKeyName\": {\r\n \"title\": \"Latitude key name\",\r\n \"type\": \"string\",\r\n \"default\": \"latitude\"\r\n },\r\n \"lngKeyName\": {\r\n \"title\": \"Longitude key name\",\r\n \"type\": \"string\",\r\n \"default\": \"longitude\"\r\n },\r\n \"showLabel\": {\r\n \"title\": \"Show label\",\r\n \"type\": \"boolean\",\r\n \"default\": true\r\n },\r\n \"label\": {\r\n \"title\": \"Label (pattern examples: '${entityName}', '${entityName}: (Text ${keyName} units.)' )\",\r\n \"type\": \"string\",\r\n \"default\": \"${entityName}\"\r\n },\r\n \"useLabelFunction\": {\r\n \"title\": \"Use label function\",\r\n \"type\": \"boolean\",\r\n \"default\": false\r\n },\r\n \"labelFunction\": {\r\n \"title\": \"Label function: f(data, dsData, dsIndex)\",\r\n \"type\": \"string\"\r\n },\r\n \"showTooltip\": {\r\n \"title\": \"Show tooltip\",\r\n \"type\": \"boolean\",\r\n \"default\": true\r\n },\r\n \"tooltipColor\": {\r\n \"title\": \"Tooltip background color\",\r\n \"type\": \"string\",\r\n \"default\": \"#fff\"\r\n },\r\n \"tooltipFontColor\": {\r\n \"title\": \"Tooltip font color\",\r\n \"type\": \"string\",\r\n \"default\": \"#000\"\r\n },\r\n \"tooltipOpacity\": {\r\n \"title\": \"Tooltip opacity (0-1)\",\r\n \"type\": \"number\",\r\n \"default\": 1 \r\n },\r\n \"tooltipPattern\": {\r\n \"title\": \"Tooltip (for ex. 'Text ${keyName} units.' or Link text')\",\r\n \"type\": \"string\",\r\n \"default\": \"${entityName}

Latitude: ${latitude:7}
Longitude: ${longitude:7}
End Time: ${maxTime}
Start Time: ${minTime}\"\r\n },\r\n \"useTooltipFunction\": {\r\n \"title\": \"Use tooltip function\",\r\n \"type\": \"boolean\",\r\n \"default\": false\r\n },\r\n \"tooltipFunction\": {\r\n \"title\": \"Tooltip function: f(data, dsData, dsIndex)\",\r\n \"type\": \"string\"\r\n },\r\n \"color\": {\r\n \"title\": \"Stroke color\",\r\n \"type\": \"string\"\r\n },\r\n \"strokeWeight\": {\r\n \"title\": \"Stroke weight\",\r\n \"type\": \"number\",\r\n \"default\": 2\r\n },\r\n \"strokeOpacity\": {\r\n \"title\": \"Stroke opacity\",\r\n \"type\": \"number\",\r\n \"default\": 1\r\n },\r\n \"useColorFunction\": {\r\n \"title\": \"Use stroke color function\",\r\n \"type\": \"boolean\",\r\n \"default\": false\r\n },\r\n \"colorFunction\": {\r\n \"title\": \"Stroke color function: f(data, dsData, dsIndex)\",\r\n \"type\": \"string\"\r\n },\r\n \"showPoints\": {\r\n \"title\": \"Show points\",\r\n \"type\": \"boolean\",\r\n \"default\": false\r\n },\r\n \"pointColor\": {\r\n \"title\": \"Point color\",\r\n \"type\": \"string\"\r\n },\r\n \"pointSize\": {\r\n \"title\": \"Point size (px)\",\r\n \"type\": \"number\",\r\n \"default\": 10\r\n },\r\n \"defaultMarkerColor\": {\r\n \"title\": \"color for default marker\",\r\n \"type\": \"string\"\r\n },\r\n \"markerImage\": {\r\n \"title\": \"Custom marker image\",\r\n \"type\": \"string\"\r\n },\r\n \"markerImageSize\": {\r\n \"title\": \"Custom marker image size (px)\",\r\n \"type\": \"number\",\r\n \"default\": 34\r\n },\r\n \"rotationAngle\": {\r\n \"title\": \"Set additional rotation angle for marker (deg)\",\r\n \"type\": \"number\",\r\n \"default\": 180\r\n },\r\n \"useMarkerImageFunction\":{\r\n \"title\":\"Use marker image function\",\r\n \"type\":\"boolean\",\r\n \"default\":false\r\n },\r\n \"markerImageFunction\":{\r\n \"title\":\"Marker image function: f(data, images, dsData, dsIndex)\",\r\n \"type\":\"string\"\r\n },\r\n \"markerImages\":{\r\n \"title\":\"Marker images\",\r\n \"type\":\"array\",\r\n \"items\":{\r\n \"title\":\"Marker image\",\r\n \"type\":\"string\"\r\n }\r\n }\r\n },\r\n \"required\": []\r\n },\r\n \"form\": [{\r\n \"key\": \"mapProvider\",\r\n \"type\": \"rc-select\",\r\n \"multiple\": false,\r\n \"items\": [{\r\n \"value\": \"OpenStreetMap.Mapnik\",\r\n \"label\": \"OpenStreetMap.Mapnik (Default)\"\r\n }, {\r\n \"value\": \"OpenStreetMap.BlackAndWhite\",\r\n \"label\": \"OpenStreetMap.BlackAndWhite\"\r\n }, {\r\n \"value\": \"OpenStreetMap.HOT\",\r\n \"label\": \"OpenStreetMap.HOT\"\r\n }, {\r\n \"value\": \"Esri.WorldStreetMap\",\r\n \"label\": \"Esri.WorldStreetMap\"\r\n }, {\r\n \"value\": \"Esri.WorldTopoMap\",\r\n \"label\": \"Esri.WorldTopoMap\"\r\n }, {\r\n \"value\": \"CartoDB.Positron\",\r\n \"label\": \"CartoDB.Positron\"\r\n }, {\r\n \"value\": \"CartoDB.DarkMatter\",\r\n \"label\": \"CartoDB.DarkMatter\"\r\n }]\r\n },\"defaultZoomLevel\", \"fitMapBounds\", \"latKeyName\", \"lngKeyName\", \"showLabel\", \"label\", \"useLabelFunction\", {\r\n \"key\": \"labelFunction\",\r\n \"type\": \"javascript\"\r\n }, \"showTooltip\", {\r\n \"key\": \"tooltipColor\",\r\n \"type\": \"color\"\r\n }, {\r\n \"key\": \"tooltipFontColor\",\r\n \"type\": \"color\"\r\n },\"tooltipOpacity\", {\r\n \"key\": \"tooltipPattern\",\r\n \"type\": \"textarea\"\r\n }, \"useTooltipFunction\", {\r\n \"key\": \"tooltipFunction\",\r\n \"type\": \"javascript\"\r\n }, {\r\n \"key\": \"color\",\r\n \"type\": \"color\"\r\n }, \"useColorFunction\", {\r\n \"key\": \"colorFunction\",\r\n \"type\": \"javascript\"\r\n }, \"strokeWeight\", \"strokeOpacity\", \"showPoints\",{\r\n \"key\": \"pointColor\",\r\n \"type\": \"color\"\r\n }, \"pointSize\", {\r\n \"key\": \"defaultMarkerColor\",\r\n \"type\": \"color\"\r\n }, {\r\n \"key\": \"markerImage\",\r\n \"type\": \"image\"\r\n }, \"markerImageSize\", \"rotationAngle\",\"useMarkerImageFunction\",\r\n {\r\n \"key\":\"markerImageFunction\",\r\n \"type\":\"javascript\"\r\n }, {\r\n \"key\":\"markerImages\",\r\n \"items\":[\r\n {\r\n \"key\":\"markerImages[]\",\r\n \"type\":\"image\"\r\n }\r\n ]\r\n }]\r\n}", + "settingsSchema": "{\n \"schema\": {\n \"title\": \"Openstreet Map Configuration\",\n \"type\": \"object\",\n \"properties\": {\n \"mapProvider\": {\n \"title\": \"Map provider\",\n \"type\": \"string\",\n \"default\": \"OpenStreetMap.Mapnik\"\n },\n \"latKeyName\": {\n \"title\": \"Latitude key name\",\n \"type\": \"string\",\n \"default\": \"latitude\"\n },\n \"lngKeyName\": {\n \"title\": \"Longitude key name\",\n \"type\": \"string\",\n \"default\": \"longitude\"\n },\n \"polKeyName\": {\n \"title\": \"Polygon key name\",\n \"type\": \"string\",\n \"default\": \"coordinates\"\n },\n \"showLabel\": {\n \"title\": \"Show label\",\n \"type\": \"boolean\",\n \"default\": true\n },\n \"label\": {\n \"title\": \"Label (pattern examples: '${entityName}', '${entityName}: (Text ${keyName} units.)' )\",\n \"type\": \"string\",\n \"default\": \"${entityName}\"\n },\n \"useLabelFunction\": {\n \"title\": \"Use label function\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"labelFunction\": {\n \"title\": \"Label function: f(data, dsData, dsIndex)\",\n \"type\": \"string\"\n },\n \"showTooltip\": {\n \"title\": \"Show tooltip\",\n \"type\": \"boolean\",\n \"default\": true\n },\n \"tooltipColor\": {\n \"title\": \"Tooltip background color\",\n \"type\": \"string\",\n \"default\": \"#fff\"\n },\n \"tooltipFontColor\": {\n \"title\": \"Tooltip font color\",\n \"type\": \"string\",\n \"default\": \"#000\"\n },\n \"tooltipOpacity\": {\n \"title\": \"Tooltip opacity (0-1)\",\n \"type\": \"number\",\n \"default\": 1 \n },\n \"tooltipPattern\": {\n \"title\": \"Tooltip (for ex. 'Text ${keyName} units.' or Link text')\",\n \"type\": \"string\",\n \"default\": \"${entityName}

Latitude: ${latitude:7}
Longitude: ${longitude:7}\"\n },\n \"useTooltipFunction\": {\n \"title\": \"Use tooltip function\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"tooltipFunction\": {\n \"title\": \"Tooltip function: f(data, dsData, dsIndex)\",\n \"type\": \"string\"\n },\n \"color\": {\n \"title\": \"Path color\",\n \"type\": \"string\"\n },\n \"strokeWeight\": {\n \"title\": \"Stroke weight\",\n \"type\": \"number\",\n \"default\": 2\n },\n \"strokeOpacity\": {\n \"title\": \"Stroke opacity\",\n \"type\": \"number\",\n \"default\": 1\n },\n \"useColorFunction\": {\n \"title\": \"Use path color function\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"colorFunction\": {\n \"title\": \"Path color function: f(data, dsData, dsIndex)\",\n \"type\": \"string\"\n },\n \"showPolygon\": {\n \"title\": \"Show polygon\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"polygonTooltipPattern\": {\n \"title\": \"Tooltip (for ex. 'Text ${keyName} units.' or Link text')\",\n \"type\": \"string\",\n \"default\": \"${entityName}

TimeStamp: ${ts:7}\"\n },\n \"usePolygonTooltipFunction\": {\n\t\t\t\t\"title\": \"Use polygon tooltip function\",\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"polygonTooltipFunction\": {\n\t\t\t\t\"title\": \"Polygon tooltip function: f(data, dsData, dsIndex)\",\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n \"polygonColor\": {\n\t\t\t\t\t\"title\": \"Polygon color\",\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"polygonOpacity\": {\n\t\t\t\t\"title\": \"Polygon opacity\",\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"default\": 0.5\n\t\t\t},\n\t\t\t\"polygonStrokeColor\": {\n\t\t\t\t\"title\": \"Polygon border color\",\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"polygonStrokeOpacity\": {\n\t\t\t\t\"title\": \"Polygon border opacity\",\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"default\": 1\n\t\t\t},\n\t\t\t\"polygonStrokeWeight\": {\n\t\t\t\t\"title\": \"Polygon border weight\",\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"default\": 1\n\t\t\t},\n\t\t\t\"usePolygonColorFunction\": {\n\t\t\t\t\"title\": \"Use polygon color function\",\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"polygonColorFunction\": {\n\t\t\t\t\"title\": \"Polygon Color function: f(data, dsData, dsIndex)\",\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n \"showPoints\": {\n \"title\": \"Show points\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"pointColor\": {\n \"title\": \"Point color\",\n \"type\": \"string\"\n },\n \"pointSize\": {\n \"title\": \"Point size (px)\",\n \"type\": \"number\",\n \"default\": 10\n },\n \"defaultMarkerColor\": {\n \"title\": \"color for default marker\",\n \"type\": \"string\"\n },\n \"markerImage\": {\n \"title\": \"Custom marker image\",\n \"type\": \"string\"\n },\n \"markerImageSize\": {\n \"title\": \"Custom marker image size (px)\",\n \"type\": \"number\",\n \"default\": 34\n },\n \"rotationAngle\": {\n \"title\": \"Set additional rotation angle for marker (deg)\",\n \"type\": \"number\",\n \"default\": 180\n },\n \"useMarkerImageFunction\":{\n \"title\":\"Use marker image function\",\n \"type\":\"boolean\",\n \"default\":false\n },\n \"markerImageFunction\":{\n \"title\":\"Marker image function: f(data, images, dsData, dsIndex)\",\n \"type\":\"string\"\n },\n \"markerImages\":{\n \"title\":\"Marker images\",\n \"type\":\"array\",\n \"items\":{\n \"title\":\"Marker image\",\n \"type\":\"string\"\n }\n }\n },\n \"required\": []\n },\n \"form\": [{\n \"key\": \"mapProvider\",\n \"type\": \"rc-select\",\n \"multiple\": false,\n \"items\": [{\n \"value\": \"OpenStreetMap.Mapnik\",\n \"label\": \"OpenStreetMap.Mapnik (Default)\"\n }, {\n \"value\": \"OpenStreetMap.BlackAndWhite\",\n \"label\": \"OpenStreetMap.BlackAndWhite\"\n }, {\n \"value\": \"OpenStreetMap.HOT\",\n \"label\": \"OpenStreetMap.HOT\"\n }, {\n \"value\": \"Esri.WorldStreetMap\",\n \"label\": \"Esri.WorldStreetMap\"\n }, {\n \"value\": \"Esri.WorldTopoMap\",\n \"label\": \"Esri.WorldTopoMap\"\n }, {\n \"value\": \"CartoDB.Positron\",\n \"label\": \"CartoDB.Positron\"\n }, {\n \"value\": \"CartoDB.DarkMatter\",\n \"label\": \"CartoDB.DarkMatter\"\n }]\n }, \"latKeyName\", \"lngKeyName\", \"polKeyName\", \"showLabel\", \"label\", \"useLabelFunction\", {\n \"key\": \"labelFunction\",\n \"type\": \"javascript\"\n }, \"showTooltip\", {\n \"key\": \"tooltipColor\",\n \"type\": \"color\"\n }, {\n \"key\": \"tooltipFontColor\",\n \"type\": \"color\"\n },\"tooltipOpacity\", {\n \"key\": \"tooltipPattern\",\n \"type\": \"textarea\"\n }, \"useTooltipFunction\", {\n \"key\": \"tooltipFunction\",\n \"type\": \"javascript\"\n }, {\n \"key\": \"color\",\n \"type\": \"color\"\n }, \"useColorFunction\", {\n \"key\": \"colorFunction\",\n \"type\": \"javascript\"\n }, \"strokeWeight\", \"strokeOpacity\", \"showPolygon\", {\n \"key\": \"polygonTooltipPattern\",\n \"type\": \"textarea\"\n },\"usePolygonTooltipFunction\", {\n \"key\": \"polygonTooltipFunction\",\n \"type\": \"javascript\"\n },{\n\t\t\"key\": \"polygonColor\",\n\t\t\"type\": \"color\"\n\t},\t\"polygonOpacity\", {\n\t\t\"key\": \"polygonStrokeColor\",\n\t\t\"type\": \"color\"\n\t},\t\"polygonStrokeOpacity\",\"polygonStrokeWeight\",\"usePolygonColorFunction\",\t{\n\t\t\"key\": \"polygonColorFunction\",\n\t\t\"type\": \"javascript\"\n\t},\"showPoints\",{\n \"key\": \"pointColor\",\n \"type\": \"color\"\n }, \"pointSize\", {\n \"key\": \"defaultMarkerColor\",\n \"type\": \"color\"\n }, {\n \"key\": \"markerImage\",\n \"type\": \"image\"\n }, \"markerImageSize\", \"rotationAngle\",\"useMarkerImageFunction\",\n {\n \"key\":\"markerImageFunction\",\n \"type\":\"javascript\"\n }, {\n \"key\":\"markerImages\",\n \"items\":[\n {\n \"key\":\"markerImages[]\",\n \"type\":\"image\"\n }\n ]\n }]\n}", "dataKeySettingsSchema": "{}", - "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"Route\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"latitude\",\"color\":\"#2196f3\",\"settings\":{\"showLines\":true,\"fillLines\":true,\"showPoints\":false},\"_hash\":0.8587686344902596,\"funcBody\":\"var lats = [37.7696499,\\n37.7699074,\\n37.7699536,\\n37.7697242,\\n37.7695189,\\n37.7696889,\\n37.7697153,\\n37.7701244,\\n37.7700604,\\n37.7705491,\\n37.7715705,\\n37.771752,\\n37.7707533,\\n37.769866];\\n\\nvar i = Math.floor((time/3 % 14000) / 1000);\\n\\nreturn lats[i];\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"longitude\",\"color\":\"#4caf50\",\"settings\":{\"showLines\":true,\"fillLines\":false,\"showPoints\":false},\"_hash\":0.12775350966079668,\"funcBody\":\"var lons = [-122.4261215,\\n-122.4219157,\\n-122.4199623,\\n-122.4179074,\\n-122.4155876,\\n-122.4155521,\\n-122.4163203,\\n-122.4193876,\\n-122.4210496,\\n-122.422284,\\n-122.4232717,\\n-122.4235138,\\n-122.4247605,\\n-122.4258812];\\n\\nvar i = Math.floor((time/3 % 14000) / 1000);\\n\\nreturn lons[i];\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"mapProvider\":\"OpenStreetMap.Mapnik\",\"fitMapBounds\":true,\"latKeyName\":\"latitude\",\"lngKeyName\":\"longitude\",\"showLabel\":true,\"label\":\"${entityName}\",\"showTooltip\":true,\"tooltipColor\":\"#fff\",\"tooltipFontColor\":\"#000\",\"tooltipOpacity\":1,\"tooltipPattern\":\"${entityName}\\n
\\nTime: ${formattedTs}\\nLatitude: ${latitude:7}\\nLongitude: ${longitude:7}\",\"strokeWeight\":3,\"strokeOpacity\":1,\"pointSize\":10,\"markerImageSize\":34,\"rotationAngle\":180},\"title\":\"Trip Animation\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"mobileHeight\":null,\"widgetStyle\":{},\"useDashboardTimewindow\":true,\"showLegend\":false,\"actions\":{},\"legendConfig\":{\"position\":\"bottom\",\"showMin\":false,\"showMax\":false,\"showAvg\":false,\"showTotal\":false}}" + "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"latitude\",\"color\":\"#2196f3\",\"settings\":{\"showLines\":true,\"fillLines\":true,\"showPoints\":false},\"_hash\":0.8587686344902596,\"funcBody\":\"var gpsData = [\\n\\t37.771210000,-122.510960000,\\n\\t37.771340000,-122.510980000,\\n\\t37.771340000,-122.510980000,\\n\\t37.771360000,-122.510850000,\\n\\t37.771380000,-122.510550000,\\n\\t37.771400000,-122.509900000,\\n\\t37.771410000,-122.509660000,\\n\\t37.771430000,-122.509360000,\\n\\t37.771430000,-122.509270000,\\n\\t37.771450000,-122.508840000,\\n\\t37.771490000,-122.507880000,\\n\\t37.771490000,-122.507780000,\\n\\t37.771530000,-122.507140000,\\n\\t37.771550000,-122.506690000,\\n\\t37.771560000,-122.506310000,\\n\\t37.771600000,-122.505640000,\\n\\t37.771650000,-122.504540000,\\n\\t37.771670000,-122.503990000,\\n\\t37.771700000,-122.503490000,\\n\\t37.771740000,-122.502430000,\\n\\t37.771790000,-122.501360000,\\n\\t37.771840000,-122.500290000,\\n\\t37.771870000,-122.499730000,\\n\\t37.771890000,-122.499210000,\\n\\t37.771940000,-122.498140000,\\n\\t37.771990000,-122.497070000,\\n\\t37.772000000,-122.496690000,\\n\\t37.772020000,-122.496350000,\\n\\t37.772030000,-122.496110000,\\n\\t37.772040000,-122.496000000,\\n\\t37.772040000,-122.495890000,\\n\\t37.772060000,-122.495440000,\\n\\t37.772090000,-122.494930000,\\n\\t37.772120000,-122.494160000,\\n\\t37.772130000,-122.493860000,\\n\\t37.772180000,-122.492790000,\\n\\t37.772200000,-122.492300000,\\n\\t37.772220000,-122.491840000,\\n\\t37.772230000,-122.491710000,\\n\\t37.772280000,-122.490630000,\\n\\t37.772330000,-122.489560000,\\n\\t37.772330000,-122.489470000,\\n\\t37.772360000,-122.489030000,\\n\\t37.772380000,-122.488490000,\\n\\t37.772430000,-122.487420000,\\n\\t37.772450000,-122.486980000,\\n\\t37.772480000,-122.486360000,\\n\\t37.772520000,-122.485280000,\\n\\t37.772560000,-122.484400000,\\n\\t37.772570000,-122.484300000,\\n\\t37.772570000,-122.484150000,\\n\\t37.772620000,-122.483140000,\\n\\t37.772680000,-122.482050000,\\n\\t37.772700000,-122.481370000,\\n\\t37.772710000,-122.481000000,\\n\\t37.772730000,-122.480740000,\\n\\t37.772770000,-122.479930000,\\n\\t37.772820000,-122.478860000,\\n\\t37.772870000,-122.477790000,\\n\\t37.772900000,-122.477110000,\\n\\t37.772920000,-122.476710000,\\n\\t37.772960000,-122.475650000,\\n\\t37.772990000,-122.474950000,\\n\\t37.773010000,-122.474580000,\\n\\t37.773060000,-122.473450000,\\n\\t37.773120000,-122.472330000,\\n\\t37.773140000,-122.471850000,\\n\\t37.773140000,-122.471730000,\\n\\t37.773150000,-122.471640000,\\n\\t37.773170000,-122.471260000,\\n\\t37.773190000,-122.470570000,\\n\\t37.773210000,-122.470190000,\\n\\t37.773230000,-122.469770000,\\n\\t37.773250000,-122.469370000,\\n\\t37.773260000,-122.469120000,\\n\\t37.773290000,-122.468490000,\\n\\t37.773300000,-122.468150000,\\n\\t37.773310000,-122.468050000,\\n\\t37.773310000,-122.467940000,\\n\\t37.773320000,-122.467740000,\\n\\t37.773350000,-122.467270000,\\n\\t37.773360000,-122.466980000,\\n\\t37.773360000,-122.466870000,\\n\\t37.773370000,-122.466610000,\\n\\t37.773390000,-122.466300000,\\n\\t37.773400000,-122.466000000,\\n\\t37.773400000,-122.465910000,\\n\\t37.773410000,-122.465790000,\\n\\t37.773430000,-122.465520000,\\n\\t37.773460000,-122.465210000,\\n\\t37.773490000,-122.464980000,\\n\\t37.773500000,-122.464910000,\\n\\t37.773460000,-122.464830000,\\n\\t37.773560000,-122.464070000,\\n\\t37.773580000,-122.463900000,\\n\\t37.773590000,-122.463810000,\\n\\t37.773600000,-122.463780000,\\n\\t37.773610000,-122.463670000,\\n\\t37.773660000,-122.463320000,\\n\\t37.773740000,-122.462700000,\\n\\t37.773770000,-122.462440000,\\n\\t37.773860000,-122.461730000,\\n\\t37.773870000,-122.461640000,\\n\\t37.773920000,-122.461260000,\\n\\t37.773970000,-122.460890000,\\n\\t37.774010000,-122.460570000,\\n\\t37.774110000,-122.459760000,\\n\\t37.774140000,-122.459490000,\\n\\t37.774270000,-122.458520000,\\n\\t37.774270000,-122.458440000,\\n\\t37.774270000,-122.458380000,\\n\\t37.774320000,-122.458270000,\\n\\t37.774340000,-122.458050000,\\n\\t37.774510000,-122.456680000,\\n\\t37.774560000,-122.456310000,\\n\\t37.774700000,-122.455280000,\\n\\t37.774760000,-122.454780000,\\n\\t37.774770000,-122.454670000,\\n\\t37.774770000,-122.454670000,\\n\\t37.774670000,-122.454650000,\\n\\t37.774670000,-122.454650000,\\n\\t37.774580000,-122.454640000,\\n\\t37.774300000,-122.454580000,\\n\\t37.774190000,-122.454560000,\\n\\t37.773700000,-122.454460000,\\n\\t37.772910000,-122.454310000,\\n\\t37.772620000,-122.454260000,\\n\\t37.772430000,-122.454220000,\\n\\t37.771980000,-122.454110000,\\n\\t37.771910000,-122.454100000,\\n\\t37.771760000,-122.454060000,\\n\\t37.771690000,-122.454050000,\\n\\t37.771620000,-122.454030000,\\n\\t37.771530000,-122.454010000,\\n\\t37.771380000,-122.453970000,\\n\\t37.771250000,-122.453950000,\\n\\t37.771100000,-122.453930000,\\n\\t37.771020000,-122.453920000,\\n\\t37.770920000,-122.453900000,\\n\\t37.770810000,-122.453890000,\\n\\t37.770660000,-122.453860000,\\n\\t37.770110000,-122.453750000,\\n\\t37.769560000,-122.453640000,\\n\\t37.769360000,-122.453600000,\\n\\t37.769250000,-122.453580000,\\n\\t37.769180000,-122.453560000,\\n\\t37.769090000,-122.453540000,\\n\\t37.768780000,-122.453480000,\\n\\t37.768250000,-122.453380000,\\n\\t37.768160000,-122.453360000,\\n\\t37.767820000,-122.453290000,\\n\\t37.767310000,-122.453190000,\\n\\t37.767160000,-122.453160000,\\n\\t37.767010000,-122.453130000,\\n\\t37.766760000,-122.453070000,\\n\\t37.766550000,-122.453030000,\\n\\t37.766550000,-122.453030000,\\n\\t37.766390000,-122.452990000,\\n\\t37.766390000,-122.452990000,\\n\\t37.766290000,-122.453720000,\\n\\t37.766180000,-122.454610000,\\n\\t37.766130000,-122.454980000,\\n\\t37.765960000,-122.456290000,\\n\\t37.765960000,-122.456340000,\\n\\t37.765960000,-122.456360000,\\n\\t37.765960000,-122.456380000,\\n\\t37.765960000,-122.456410000,\\n\\t37.765960000,-122.456460000,\\n\\t37.765940000,-122.456630000,\\n\\t37.765930000,-122.456700000,\\n\\t37.765920000,-122.456810000,\\n\\t37.765910000,-122.456930000,\\n\\t37.765910000,-122.457020000,\\n\\t37.765920000,-122.457160000,\\n\\t37.765930000,-122.457270000,\\n\\t37.765940000,-122.457360000,\\n\\t37.765950000,-122.457410000,\\n\\t37.765960000,-122.457470000,\\n\\t37.765980000,-122.457560000,\\n\\t37.766010000,-122.457660000,\\n\\t37.766070000,-122.457830000,\\n\\t37.766070000,-122.457830000,\\n\\t37.766120000,-122.457980000,\\n\\t37.766180000,-122.458180000,\\n\\t37.766190000,-122.458200000,\\n\\t37.766240000,-122.458400000,\\n\\t37.766270000,-122.458530000,\\n\\t37.766290000,-122.458600000,\\n\\t37.766300000,-122.458690000,\\n\\t37.766300000,-122.458880000,\\n\\t37.766300000,-122.458970000,\\n\\t37.766280000,-122.459470000,\\n\\t37.766270000,-122.459520000,\\n\\t37.766270000,-122.459560000,\\n\\t37.766280000,-122.459600000,\\n\\t37.766280000,-122.459630000,\\n\\t37.766290000,-122.459670000,\\n\\t37.766300000,-122.459700000,\\n\\t37.766310000,-122.459730000,\\n\\t37.766320000,-122.459750000,\\n\\t37.766330000,-122.459770000,\\n\\t37.766350000,-122.459800000,\\n\\t37.766390000,-122.459860000,\\n\\t37.766340000,-122.459970000,\\n\\t37.766290000,-122.460150000,\\n\\t37.766290000,-122.460230000,\\n\\t37.766280000,-122.460280000,\\n\\t37.766260000,-122.460330000,\\n\\t37.766250000,-122.460420000,\\n\\t37.766240000,-122.460520000,\\n\\t37.766230000,-122.460670000,\\n\\t37.766230000,-122.460800000,\\n\\t37.766230000,-122.460900000,\\n\\t37.766210000,-122.461110000,\\n\\t37.766170000,-122.462030000,\\n\\t37.766160000,-122.462170000,\\n\\t37.766150000,-122.462520000,\\n\\t37.766120000,-122.463260000,\\n\\t37.766090000,-122.464130000,\\n\\t37.766070000,-122.464350000,\\n\\t37.766070000,-122.464440000,\\n\\t37.766060000,-122.464620000,\\n\\t37.766030000,-122.465400000,\\n\\t37.765980000,-122.466470000,\\n\\t37.765940000,-122.467530000,\\n\\t37.765930000,-122.467680000,\\n\\t37.765890000,-122.468600000,\\n\\t37.765860000,-122.468980000,\\n\\t37.765830000,-122.469660000,\\n\\t37.765780000,-122.470740000,\\n\\t37.765770000,-122.471030000,\\n\\t37.765770000,-122.471140000,\\n\\t37.765760000,-122.471380000,\\n\\t37.765740000,-122.471820000,\\n\\t37.765690000,-122.472950000,\\n\\t37.765680000,-122.473220000,\\n\\t37.765670000,-122.473320000,\\n\\t37.765640000,-122.474070000,\\n\\t37.765590000,-122.475140000,\\n\\t37.765590000,-122.475400000,\\n\\t37.765580000,-122.475520000,\\n\\t37.765550000,-122.476200000,\\n\\t37.765500000,-122.477180000,\\n\\t37.765500000,-122.477280000,\\n\\t37.765490000,-122.477400000,\\n\\t37.765490000,-122.477440000,\\n\\t37.765490000,-122.477440000,\\n\\t37.765490000,-122.477490000,\\n\\t37.765470000,-122.477770000,\\n\\t37.765450000,-122.478340000,\\n\\t37.765450000,-122.478420000,\\n\\t37.765430000,-122.478870000,\\n\\t37.765400000,-122.479430000,\\n\\t37.765380000,-122.479810000,\\n\\t37.765350000,-122.480480000,\\n\\t37.765300000,-122.481570000,\\n\\t37.765300000,-122.481660000,\\n\\t37.765290000,-122.481950000,\\n\\t37.765260000,-122.482640000,\\n\\t37.765220000,-122.483570000,\\n\\t37.765210000,-122.483710000,\\n\\t37.765210000,-122.483810000,\\n\\t37.765190000,-122.484130000,\\n\\t37.765160000,-122.484780000,\\n\\t37.765120000,-122.485860000,\\n\\t37.765110000,-122.485960000,\\n\\t37.765100000,-122.486170000,\\n\\t37.765070000,-122.486930000,\\n\\t37.765020000,-122.488000000,\\n\\t37.765020000,-122.488100000,\\n\\t37.765000000,-122.488360000,\\n\\t37.764980000,-122.488970000,\\n\\t37.764970000,-122.489070000,\\n\\t37.764930000,-122.490150000,\\n\\t37.764920000,-122.490240000,\\n\\t37.764910000,-122.490490000,\\n\\t37.764880000,-122.491210000,\\n\\t37.764830000,-122.492290000,\\n\\t37.764790000,-122.493260000,\\n\\t37.764780000,-122.493350000,\\n\\t37.764740000,-122.494420000,\\n\\t37.764720000,-122.494730000,\\n\\t37.764710000,-122.495500000,\\n\\t37.764700000,-122.495630000,\\n\\t37.764690000,-122.495940000,\\n\\t37.764680000,-122.496260000,\\n\\t37.764670000,-122.496480000,\\n\\t37.764600000,-122.497490000,\\n\\t37.764590000,-122.497650000,\\n\\t37.764550000,-122.498720000,\\n\\t37.764500000,-122.499780000,\\n\\t37.764450000,-122.500870000,\\n\\t37.764440000,-122.501060000,\\n\\t37.764400000,-122.501930000,\\n\\t37.764360000,-122.502990000,\\n\\t37.764310000,-122.504080000,\\n\\t37.764260000,-122.505140000,\\n\\t37.764260000,-122.505250000,\\n\\t37.764220000,-122.506220000,\\n\\t37.764170000,-122.507280000,\\n\\t37.764120000,-122.508360000,\\n\\t37.764100000,-122.508850000,\\n\\t37.764100000,-122.509150000,\\n\\t37.764100000,-122.509440000,\\n\\t37.764090000,-122.509760000,\\n\\t37.764080000,-122.510200000,\\n\\t37.764070000,-122.510320000,\\n\\t37.764060000,-122.510430000,\\n\\t37.764030000,-122.510430000,\\n\\t37.764030000,-122.510430000,\\n\\t37.763960000,-122.510430000,\\n\\t37.763960000,-122.510290000,\\n\\t37.764070000,-122.510320000,\\n\\t37.764170000,-122.510320000,\\n\\t37.764410000,-122.510340000,\\n\\t37.764610000,-122.510350000,\\n\\t37.764780000,-122.510330000,\\n\\t37.764960000,-122.510310000,\\n\\t37.765340000,-122.510280000,\\n\\t37.765570000,-122.510260000,\\n\\t37.765840000,-122.510250000,\\n\\t37.765900000,-122.510250000,\\n\\t37.766140000,-122.510260000,\\n\\t37.766410000,-122.510260000,\\n\\t37.766620000,-122.510270000,\\n\\t37.767040000,-122.510310000,\\n\\t37.767270000,-122.510330000,\\n\\t37.767620000,-122.510390000,\\n\\t37.767670000,-122.510390000,\\n\\t37.767740000,-122.510410000,\\n\\t37.767840000,-122.510430000,\\n\\t37.768280000,-122.510530000,\\n\\t37.768620000,-122.510600000,\\n\\t37.768690000,-122.510620000,\\n\\t37.769020000,-122.510690000,\\n\\t37.769260000,-122.510730000,\\n\\t37.769420000,-122.510750000,\\n\\t37.770010000,-122.510830000,\\n\\t37.770340000,-122.510860000,\\n\\t37.770460000,-122.510870000,\\n\\t37.770930000,-122.510930000,\\n\\t37.770980000,-122.510930000,\\n];\\n let value = gpsData.indexOf(prevValue); \\nreturn gpsData[(value == -1 ? 0 : value + 2)];\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"longitude\",\"color\":\"#ffc107\",\"settings\":{\"showLines\":true,\"fillLines\":false,\"showPoints\":false},\"_hash\":0.12775350966079668,\"funcBody\":\"var gpsData = [\\n\\t37.771210000,-122.510960000,\\n\\t37.771340000,-122.510980000,\\n\\t37.771340000,-122.510980000,\\n\\t37.771360000,-122.510850000,\\n\\t37.771380000,-122.510550000,\\n\\t37.771400000,-122.509900000,\\n\\t37.771410000,-122.509660000,\\n\\t37.771430000,-122.509360000,\\n\\t37.771430000,-122.509270000,\\n\\t37.771450000,-122.508840000,\\n\\t37.771490000,-122.507880000,\\n\\t37.771490000,-122.507780000,\\n\\t37.771530000,-122.507140000,\\n\\t37.771550000,-122.506690000,\\n\\t37.771560000,-122.506310000,\\n\\t37.771600000,-122.505640000,\\n\\t37.771650000,-122.504540000,\\n\\t37.771670000,-122.503990000,\\n\\t37.771700000,-122.503490000,\\n\\t37.771740000,-122.502430000,\\n\\t37.771790000,-122.501360000,\\n\\t37.771840000,-122.500290000,\\n\\t37.771870000,-122.499730000,\\n\\t37.771890000,-122.499210000,\\n\\t37.771940000,-122.498140000,\\n\\t37.771990000,-122.497070000,\\n\\t37.772000000,-122.496690000,\\n\\t37.772020000,-122.496350000,\\n\\t37.772030000,-122.496110000,\\n\\t37.772040000,-122.496000000,\\n\\t37.772040000,-122.495890000,\\n\\t37.772060000,-122.495440000,\\n\\t37.772090000,-122.494930000,\\n\\t37.772120000,-122.494160000,\\n\\t37.772130000,-122.493860000,\\n\\t37.772180000,-122.492790000,\\n\\t37.772200000,-122.492300000,\\n\\t37.772220000,-122.491840000,\\n\\t37.772230000,-122.491710000,\\n\\t37.772280000,-122.490630000,\\n\\t37.772330000,-122.489560000,\\n\\t37.772330000,-122.489470000,\\n\\t37.772360000,-122.489030000,\\n\\t37.772380000,-122.488490000,\\n\\t37.772430000,-122.487420000,\\n\\t37.772450000,-122.486980000,\\n\\t37.772480000,-122.486360000,\\n\\t37.772520000,-122.485280000,\\n\\t37.772560000,-122.484400000,\\n\\t37.772570000,-122.484300000,\\n\\t37.772570000,-122.484150000,\\n\\t37.772620000,-122.483140000,\\n\\t37.772680000,-122.482050000,\\n\\t37.772700000,-122.481370000,\\n\\t37.772710000,-122.481000000,\\n\\t37.772730000,-122.480740000,\\n\\t37.772770000,-122.479930000,\\n\\t37.772820000,-122.478860000,\\n\\t37.772870000,-122.477790000,\\n\\t37.772900000,-122.477110000,\\n\\t37.772920000,-122.476710000,\\n\\t37.772960000,-122.475650000,\\n\\t37.772990000,-122.474950000,\\n\\t37.773010000,-122.474580000,\\n\\t37.773060000,-122.473450000,\\n\\t37.773120000,-122.472330000,\\n\\t37.773140000,-122.471850000,\\n\\t37.773140000,-122.471730000,\\n\\t37.773150000,-122.471640000,\\n\\t37.773170000,-122.471260000,\\n\\t37.773190000,-122.470570000,\\n\\t37.773210000,-122.470190000,\\n\\t37.773230000,-122.469770000,\\n\\t37.773250000,-122.469370000,\\n\\t37.773260000,-122.469120000,\\n\\t37.773290000,-122.468490000,\\n\\t37.773300000,-122.468150000,\\n\\t37.773310000,-122.468050000,\\n\\t37.773310000,-122.467940000,\\n\\t37.773320000,-122.467740000,\\n\\t37.773350000,-122.467270000,\\n\\t37.773360000,-122.466980000,\\n\\t37.773360000,-122.466870000,\\n\\t37.773370000,-122.466610000,\\n\\t37.773390000,-122.466300000,\\n\\t37.773400000,-122.466000000,\\n\\t37.773400000,-122.465910000,\\n\\t37.773410000,-122.465790000,\\n\\t37.773430000,-122.465520000,\\n\\t37.773460000,-122.465210000,\\n\\t37.773490000,-122.464980000,\\n\\t37.773500000,-122.464910000,\\n\\t37.773460000,-122.464830000,\\n\\t37.773560000,-122.464070000,\\n\\t37.773580000,-122.463900000,\\n\\t37.773590000,-122.463810000,\\n\\t37.773600000,-122.463780000,\\n\\t37.773610000,-122.463670000,\\n\\t37.773660000,-122.463320000,\\n\\t37.773740000,-122.462700000,\\n\\t37.773770000,-122.462440000,\\n\\t37.773860000,-122.461730000,\\n\\t37.773870000,-122.461640000,\\n\\t37.773920000,-122.461260000,\\n\\t37.773970000,-122.460890000,\\n\\t37.774010000,-122.460570000,\\n\\t37.774110000,-122.459760000,\\n\\t37.774140000,-122.459490000,\\n\\t37.774270000,-122.458520000,\\n\\t37.774270000,-122.458440000,\\n\\t37.774270000,-122.458380000,\\n\\t37.774320000,-122.458270000,\\n\\t37.774340000,-122.458050000,\\n\\t37.774510000,-122.456680000,\\n\\t37.774560000,-122.456310000,\\n\\t37.774700000,-122.455280000,\\n\\t37.774760000,-122.454780000,\\n\\t37.774770000,-122.454670000,\\n\\t37.774770000,-122.454670000,\\n\\t37.774670000,-122.454650000,\\n\\t37.774670000,-122.454650000,\\n\\t37.774580000,-122.454640000,\\n\\t37.774300000,-122.454580000,\\n\\t37.774190000,-122.454560000,\\n\\t37.773700000,-122.454460000,\\n\\t37.772910000,-122.454310000,\\n\\t37.772620000,-122.454260000,\\n\\t37.772430000,-122.454220000,\\n\\t37.771980000,-122.454110000,\\n\\t37.771910000,-122.454100000,\\n\\t37.771760000,-122.454060000,\\n\\t37.771690000,-122.454050000,\\n\\t37.771620000,-122.454030000,\\n\\t37.771530000,-122.454010000,\\n\\t37.771380000,-122.453970000,\\n\\t37.771250000,-122.453950000,\\n\\t37.771100000,-122.453930000,\\n\\t37.771020000,-122.453920000,\\n\\t37.770920000,-122.453900000,\\n\\t37.770810000,-122.453890000,\\n\\t37.770660000,-122.453860000,\\n\\t37.770110000,-122.453750000,\\n\\t37.769560000,-122.453640000,\\n\\t37.769360000,-122.453600000,\\n\\t37.769250000,-122.453580000,\\n\\t37.769180000,-122.453560000,\\n\\t37.769090000,-122.453540000,\\n\\t37.768780000,-122.453480000,\\n\\t37.768250000,-122.453380000,\\n\\t37.768160000,-122.453360000,\\n\\t37.767820000,-122.453290000,\\n\\t37.767310000,-122.453190000,\\n\\t37.767160000,-122.453160000,\\n\\t37.767010000,-122.453130000,\\n\\t37.766760000,-122.453070000,\\n\\t37.766550000,-122.453030000,\\n\\t37.766550000,-122.453030000,\\n\\t37.766390000,-122.452990000,\\n\\t37.766390000,-122.452990000,\\n\\t37.766290000,-122.453720000,\\n\\t37.766180000,-122.454610000,\\n\\t37.766130000,-122.454980000,\\n\\t37.765960000,-122.456290000,\\n\\t37.765960000,-122.456340000,\\n\\t37.765960000,-122.456360000,\\n\\t37.765960000,-122.456380000,\\n\\t37.765960000,-122.456410000,\\n\\t37.765960000,-122.456460000,\\n\\t37.765940000,-122.456630000,\\n\\t37.765930000,-122.456700000,\\n\\t37.765920000,-122.456810000,\\n\\t37.765910000,-122.456930000,\\n\\t37.765910000,-122.457020000,\\n\\t37.765920000,-122.457160000,\\n\\t37.765930000,-122.457270000,\\n\\t37.765940000,-122.457360000,\\n\\t37.765950000,-122.457410000,\\n\\t37.765960000,-122.457470000,\\n\\t37.765980000,-122.457560000,\\n\\t37.766010000,-122.457660000,\\n\\t37.766070000,-122.457830000,\\n\\t37.766070000,-122.457830000,\\n\\t37.766120000,-122.457980000,\\n\\t37.766180000,-122.458180000,\\n\\t37.766190000,-122.458200000,\\n\\t37.766240000,-122.458400000,\\n\\t37.766270000,-122.458530000,\\n\\t37.766290000,-122.458600000,\\n\\t37.766300000,-122.458690000,\\n\\t37.766300000,-122.458880000,\\n\\t37.766300000,-122.458970000,\\n\\t37.766280000,-122.459470000,\\n\\t37.766270000,-122.459520000,\\n\\t37.766270000,-122.459560000,\\n\\t37.766280000,-122.459600000,\\n\\t37.766280000,-122.459630000,\\n\\t37.766290000,-122.459670000,\\n\\t37.766300000,-122.459700000,\\n\\t37.766310000,-122.459730000,\\n\\t37.766320000,-122.459750000,\\n\\t37.766330000,-122.459770000,\\n\\t37.766350000,-122.459800000,\\n\\t37.766390000,-122.459860000,\\n\\t37.766340000,-122.459970000,\\n\\t37.766290000,-122.460150000,\\n\\t37.766290000,-122.460230000,\\n\\t37.766280000,-122.460280000,\\n\\t37.766260000,-122.460330000,\\n\\t37.766250000,-122.460420000,\\n\\t37.766240000,-122.460520000,\\n\\t37.766230000,-122.460670000,\\n\\t37.766230000,-122.460800000,\\n\\t37.766230000,-122.460900000,\\n\\t37.766210000,-122.461110000,\\n\\t37.766170000,-122.462030000,\\n\\t37.766160000,-122.462170000,\\n\\t37.766150000,-122.462520000,\\n\\t37.766120000,-122.463260000,\\n\\t37.766090000,-122.464130000,\\n\\t37.766070000,-122.464350000,\\n\\t37.766070000,-122.464440000,\\n\\t37.766060000,-122.464620000,\\n\\t37.766030000,-122.465400000,\\n\\t37.765980000,-122.466470000,\\n\\t37.765940000,-122.467530000,\\n\\t37.765930000,-122.467680000,\\n\\t37.765890000,-122.468600000,\\n\\t37.765860000,-122.468980000,\\n\\t37.765830000,-122.469660000,\\n\\t37.765780000,-122.470740000,\\n\\t37.765770000,-122.471030000,\\n\\t37.765770000,-122.471140000,\\n\\t37.765760000,-122.471380000,\\n\\t37.765740000,-122.471820000,\\n\\t37.765690000,-122.472950000,\\n\\t37.765680000,-122.473220000,\\n\\t37.765670000,-122.473320000,\\n\\t37.765640000,-122.474070000,\\n\\t37.765590000,-122.475140000,\\n\\t37.765590000,-122.475400000,\\n\\t37.765580000,-122.475520000,\\n\\t37.765550000,-122.476200000,\\n\\t37.765500000,-122.477180000,\\n\\t37.765500000,-122.477280000,\\n\\t37.765490000,-122.477400000,\\n\\t37.765490000,-122.477440000,\\n\\t37.765490000,-122.477440000,\\n\\t37.765490000,-122.477490000,\\n\\t37.765470000,-122.477770000,\\n\\t37.765450000,-122.478340000,\\n\\t37.765450000,-122.478420000,\\n\\t37.765430000,-122.478870000,\\n\\t37.765400000,-122.479430000,\\n\\t37.765380000,-122.479810000,\\n\\t37.765350000,-122.480480000,\\n\\t37.765300000,-122.481570000,\\n\\t37.765300000,-122.481660000,\\n\\t37.765290000,-122.481950000,\\n\\t37.765260000,-122.482640000,\\n\\t37.765220000,-122.483570000,\\n\\t37.765210000,-122.483710000,\\n\\t37.765210000,-122.483810000,\\n\\t37.765190000,-122.484130000,\\n\\t37.765160000,-122.484780000,\\n\\t37.765120000,-122.485860000,\\n\\t37.765110000,-122.485960000,\\n\\t37.765100000,-122.486170000,\\n\\t37.765070000,-122.486930000,\\n\\t37.765020000,-122.488000000,\\n\\t37.765020000,-122.488100000,\\n\\t37.765000000,-122.488360000,\\n\\t37.764980000,-122.488970000,\\n\\t37.764970000,-122.489070000,\\n\\t37.764930000,-122.490150000,\\n\\t37.764920000,-122.490240000,\\n\\t37.764910000,-122.490490000,\\n\\t37.764880000,-122.491210000,\\n\\t37.764830000,-122.492290000,\\n\\t37.764790000,-122.493260000,\\n\\t37.764780000,-122.493350000,\\n\\t37.764740000,-122.494420000,\\n\\t37.764720000,-122.494730000,\\n\\t37.764710000,-122.495500000,\\n\\t37.764700000,-122.495630000,\\n\\t37.764690000,-122.495940000,\\n\\t37.764680000,-122.496260000,\\n\\t37.764670000,-122.496480000,\\n\\t37.764600000,-122.497490000,\\n\\t37.764590000,-122.497650000,\\n\\t37.764550000,-122.498720000,\\n\\t37.764500000,-122.499780000,\\n\\t37.764450000,-122.500870000,\\n\\t37.764440000,-122.501060000,\\n\\t37.764400000,-122.501930000,\\n\\t37.764360000,-122.502990000,\\n\\t37.764310000,-122.504080000,\\n\\t37.764260000,-122.505140000,\\n\\t37.764260000,-122.505250000,\\n\\t37.764220000,-122.506220000,\\n\\t37.764170000,-122.507280000,\\n\\t37.764120000,-122.508360000,\\n\\t37.764100000,-122.508850000,\\n\\t37.764100000,-122.509150000,\\n\\t37.764100000,-122.509440000,\\n\\t37.764090000,-122.509760000,\\n\\t37.764080000,-122.510200000,\\n\\t37.764070000,-122.510320000,\\n\\t37.764060000,-122.510430000,\\n\\t37.764030000,-122.510430000,\\n\\t37.764030000,-122.510430000,\\n\\t37.763960000,-122.510430000,\\n\\t37.763960000,-122.510290000,\\n\\t37.764070000,-122.510320000,\\n\\t37.764170000,-122.510320000,\\n\\t37.764410000,-122.510340000,\\n\\t37.764610000,-122.510350000,\\n\\t37.764780000,-122.510330000,\\n\\t37.764960000,-122.510310000,\\n\\t37.765340000,-122.510280000,\\n\\t37.765570000,-122.510260000,\\n\\t37.765840000,-122.510250000,\\n\\t37.765900000,-122.510250000,\\n\\t37.766140000,-122.510260000,\\n\\t37.766410000,-122.510260000,\\n\\t37.766620000,-122.510270000,\\n\\t37.767040000,-122.510310000,\\n\\t37.767270000,-122.510330000,\\n\\t37.767620000,-122.510390000,\\n\\t37.767670000,-122.510390000,\\n\\t37.767740000,-122.510410000,\\n\\t37.767840000,-122.510430000,\\n\\t37.768280000,-122.510530000,\\n\\t37.768620000,-122.510600000,\\n\\t37.768690000,-122.510620000,\\n\\t37.769020000,-122.510690000,\\n\\t37.769260000,-122.510730000,\\n\\t37.769420000,-122.510750000,\\n\\t37.770010000,-122.510830000,\\n\\t37.770340000,-122.510860000,\\n\\t37.770460000,-122.510870000,\\n\\t37.770930000,-122.510930000,\\n\\t37.770980000,-122.510930000,\\n];\\n let value = gpsData.indexOf(prevValue); \\nreturn gpsData[(value == -1 ? 1 : value + 2)];\"}]}],\"timewindow\":{\"history\":{\"interval\":1000,\"timewindowMs\":60000},\"aggregation\":{\"type\":\"NONE\",\"limit\":500}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"mapProvider\":\"OpenStreetMap.Mapnik\",\"latKeyName\":\"latitude\",\"lngKeyName\":\"longitude\",\"showLabel\":true,\"label\":\"${entityName}\",\"showTooltip\":true,\"tooltipColor\":\"#fff\",\"tooltipFontColor\":\"#000\",\"tooltipOpacity\":1,\"tooltipPattern\":\"${entityName}

Latitude: ${latitude:7}
Longitude: ${longitude:7}
End Time: ${maxTime}
Start Time: ${minTime}\",\"strokeWeight\":2,\"strokeOpacity\":1,\"pointSize\":10,\"markerImageSize\":34,\"rotationAngle\":180},\"title\":\"Trip Animation\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"mobileHeight\":null,\"widgetStyle\":{},\"useDashboardTimewindow\":false,\"showLegend\":false,\"actions\":{},\"legendConfig\":{\"position\":\"bottom\",\"showMin\":false,\"showMax\":false,\"showAvg\":false,\"showTotal\":false}}" } } ] From 426dbbeea11597b8b999cdd55c4375527367f71a Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Tue, 16 Apr 2019 11:38:22 +0300 Subject: [PATCH 20/20] Add ability to choose direction of legend items in legend settings --- ui/src/app/common/types.constant.js | 10 ++++++++++ .../legend-config-panel.controller.js | 18 ++++++++++++++++- .../components/legend-config-panel.tpl.html | 20 ++++++++++++++----- .../app/components/legend-config.directive.js | 3 +++ ui/src/app/components/legend-config.scss | 4 ++-- ui/src/app/components/legend.directive.js | 2 ++ ui/src/app/components/legend.scss | 4 ++++ ui/src/app/components/legend.tpl.html | 4 ++-- ui/src/app/locale/locale.constant-en_US.json | 5 +++++ ui/src/app/locale/locale.constant-ru_RU.json | 5 +++++ ui/src/app/locale/locale.constant-uk_UA.json | 5 +++++ 11 files changed, 70 insertions(+), 10 deletions(-) diff --git a/ui/src/app/common/types.constant.js b/ui/src/app/common/types.constant.js index ed75737ca7..8e85e1a054 100644 --- a/ui/src/app/common/types.constant.js +++ b/ui/src/app/common/types.constant.js @@ -276,6 +276,16 @@ export default angular.module('thingsboard.types', []) name: 'alias.filter-type-entity-view-search-query' } }, + direction: { + column: { + value: "column", + name: "direction.column" + }, + row: { + value: "row", + name: "direction.row" + } + }, position: { top: { value: "top", diff --git a/ui/src/app/components/legend-config-panel.controller.js b/ui/src/app/components/legend-config-panel.controller.js index 9365c3a2f2..6253da01a5 100644 --- a/ui/src/app/components/legend-config-panel.controller.js +++ b/ui/src/app/components/legend-config-panel.controller.js @@ -21,10 +21,26 @@ export default function LegendConfigPanelController(mdPanelRef, $scope, types, l vm.legendConfig = legendConfig; vm.onLegendConfigUpdate = onLegendConfigUpdate; vm.positions = types.position; + vm.directions = types.direction; + vm.isRowDirection = vm.legendConfig.direction === types.direction.row.value; vm._mdPanelRef.config.onOpenComplete = function () { $scope.theForm.$setPristine(); - } + }; + + vm.onChangeDirection = function() { + if (vm.legendConfig.direction === types.direction.row.value) { + vm.isRowDirection = true; + vm.legendConfig.position = types.position.bottom.value; + vm.legendConfig.showMin = false; + vm.legendConfig.showMax = false; + vm.legendConfig.showAvg = false; + vm.legendConfig.showTotal = false; + } + else { + vm.isRowDirection = false; + } + }; $scope.$watch('vm.legendConfig', function () { if (onLegendConfigUpdate) { diff --git a/ui/src/app/components/legend-config-panel.tpl.html b/ui/src/app/components/legend-config-panel.tpl.html index 2e4eb5f00a..848330744d 100644 --- a/ui/src/app/components/legend-config-panel.tpl.html +++ b/ui/src/app/components/legend-config-panel.tpl.html @@ -20,24 +20,34 @@
+ + + + + {{direction.name | translate}} + + + - + {{pos.name | translate}} - {{ 'legend.show-min' | translate }} - {{ 'legend.show-max' | translate }} - {{ 'legend.show-avg' | translate }} - {{ 'legend.show-total' | translate }} diff --git a/ui/src/app/components/legend-config.directive.js b/ui/src/app/components/legend-config.directive.js index f68bc0afd9..2cf59f40ec 100644 --- a/ui/src/app/components/legend-config.directive.js +++ b/ui/src/app/components/legend-config.directive.js @@ -102,6 +102,7 @@ function LegendConfig($compile, $templateCache, types, $mdPanel, $document) { scope.updateView = function () { var value = {}; var model = scope.model; + value.direction = model.direction; value.position = model.position; value.showMin = model.showMin; value.showMax = model.showMax; @@ -117,6 +118,7 @@ function LegendConfig($compile, $templateCache, types, $mdPanel, $document) { scope.model = {}; } var model = scope.model; + model.direction = value.direction || types.direction.column.value; model.position = value.position || types.position.bottom.value; model.showMin = angular.isDefined(value.showMin) ? value.showMin : false; model.showMax = angular.isDefined(value.showMax) ? value.showMax : false; @@ -124,6 +126,7 @@ function LegendConfig($compile, $templateCache, types, $mdPanel, $document) { model.showTotal = angular.isDefined(value.showTotal) ? value.showTotal : false; } else { scope.model = { + direction: types.direction.column.value, position: types.position.bottom.value, showMin: false, showMax: false, diff --git a/ui/src/app/components/legend-config.scss b/ui/src/app/components/legend-config.scss index 3f64a2fcab..e131470312 100644 --- a/ui/src/app/components/legend-config.scss +++ b/ui/src/app/components/legend-config.scss @@ -21,7 +21,7 @@ .tb-legend-config-panel { min-width: 220px; - max-height: 220px; + max-height: 300px; overflow: hidden; background: #fff; border-radius: 4px; @@ -41,7 +41,7 @@ } .md-padding { - padding: 0 16px; + padding: 12px 16px 0; } } diff --git a/ui/src/app/components/legend.directive.js b/ui/src/app/components/legend.directive.js index 4b38be22aa..76ffdb4e78 100644 --- a/ui/src/app/components/legend.directive.js +++ b/ui/src/app/components/legend.directive.js @@ -43,6 +43,8 @@ function Legend($compile, $templateCache, types) { scope.isHorizontal = scope.legendConfig.position === types.position.bottom.value || scope.legendConfig.position === types.position.top.value; + scope.isRowDirection = scope.legendConfig.direction === types.direction.row.value; + scope.toggleHideData = function(index) { scope.legendData.keys[index].dataKey.hidden = !scope.legendData.keys[index].dataKey.hidden; } diff --git a/ui/src/app/components/legend.scss b/ui/src/app/components/legend.scss index b5bc68252d..b363319e95 100644 --- a/ui/src/app/components/legend.scss +++ b/ui/src/app/components/legend.scss @@ -57,5 +57,9 @@ table.tb-legend { opacity: .6; } } + + &.tb-row-direction { + display: inline-block; + } } } diff --git a/ui/src/app/components/legend.tpl.html b/ui/src/app/components/legend.tpl.html index 31047bb8d8..d8ce5df1cb 100644 --- a/ui/src/app/components/legend.tpl.html +++ b/ui/src/app/components/legend.tpl.html @@ -17,7 +17,7 @@ --> - + @@ -26,7 +26,7 @@ - +
{{ 'legend.min' | translate }} {{ 'legend.max' | translate }}