Fixing minor issue in viewing geo fence

revert-70aa11f8
Rasika Perera 8 years ago
parent 8548e911aa
commit 4f447305c9

@ -310,7 +310,7 @@ function updateDrawing(updatedGeoJson) {
function viewFence(geoFenceElement,id) { function viewFence(geoFenceElement,id) {
var geoJson = $(geoFenceElement).attr('data-geoJson'); var geoJson = $(geoFenceElement).attr('data-geoJson');
var matchResults = /(?:"geoFenceGeoJSON"):"{(.*)}"/g.exec(geoJson); var matchResults = /(?:"geoFenceGeoJSON"):"{(.*)}"/g.exec(geoJson);
if (matchResults.length > 1) { if (matchResults && matchResults.length > 1) {
geoJson = "{" + matchResults[1] + "}"; geoJson = "{" + matchResults[1] + "}";
} }
geoJson = JSON.parse(geoJson.replace(/'/g, '"')); geoJson = JSON.parse(geoJson.replace(/'/g, '"'));

Loading…
Cancel
Save