From 23c212e145a4adba08685ceea70848c479c80639 Mon Sep 17 00:00:00 2001 From: oliver Date: Thu, 14 Jan 2016 19:19:12 +0100 Subject: [PATCH] fix handling of null-values for coordinates of Character groups Quest Stations --- .../charactergroupsqueststations/index.tpl | 34 ++++++++++--------- views/html/charactergroupsquests/quest.tpl | 19 +---------- 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/views/ajax/charactergroupsqueststations/index.tpl b/views/ajax/charactergroupsqueststations/index.tpl index 5b043181..4a15f972 100644 --- a/views/ajax/charactergroupsqueststations/index.tpl +++ b/views/ajax/charactergroupsqueststations/index.tpl @@ -6,22 +6,24 @@ // Add points foreach($stations as &$station) { - $coordinate = array( - floatval($station['longitude']), - floatval($station['latitude']) - ); - $coordinates[] = $coordinate; - $features[] = array( - 'type' => 'Feature', - 'id' => $station['id'], - 'properties' => array( - 'name' => $station['title'], - ), - 'geometry' => array( - 'type' => 'Point', - 'coordinates' => $coordinate - ) - ); + if(!is_null($station['longitude']) && !is_null($station['latitude'])) { + $coordinate = array( + floatval($station['longitude']), + floatval($station['latitude']) + ); + $coordinates[] = $coordinate; + $features[] = array( + 'type' => 'Feature', + 'id' => $station['id'], + 'properties' => array( + 'name' => $station['title'], + ), + 'geometry' => array( + 'type' => 'Point', + 'coordinates' => $coordinate + ) + ); + } } // Add lines between points diff --git a/views/html/charactergroupsquests/quest.tpl b/views/html/charactergroupsquests/quest.tpl index d2316f85..85f4d48d 100644 --- a/views/html/charactergroupsquests/quest.tpl +++ b/views/html/charactergroupsquests/quest.tpl @@ -194,28 +194,11 @@ new ol.layer.Vector({ source: markersSource, style: styleFunction - /* - style: new ol.style.Style({ - text: new ol.style.Text({ - text: '\uf041', - //text: '\uf276', - font: 'normal 28px FontAwesome', - textBaseline: 'Bottom', - fill: new ol.style.Fill({ - color: '#0F373C' - }) - }) - }) - */ - })/*, - new ol.layer.Vector({ - source: pathSource }) - */ ], target: 'map', view: new ol.View({ - center: ol.proj.transform([, ], 'EPSG:4326', 'EPSG:3857'), + center: [0, 0], zoom: 19, maxZoom: 19 })