[gnome-maps/wip/mlundblad/shape-layer-fixes: 9/9] kmlShapeLayer: Use util function to get string from buffer



commit 1fa7a28a55254084e9eecd0fca56f8c2f8b97020
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Feb 15 22:51:23 2019 +0100

    kmlShapeLayer: Use util function to get string from buffer

 src/kmlShapeLayer.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/kmlShapeLayer.js b/src/kmlShapeLayer.js
index ea13a7f..c7ef0a1 100644
--- a/src/kmlShapeLayer.js
+++ b/src/kmlShapeLayer.js
@@ -21,6 +21,7 @@ const GObject = imports.gi.GObject;
 
 const GeoJSONSource = imports.geoJSONSource;
 const ShapeLayer = imports.shapeLayer;
+const Utils = imports.utils;
 const Togeojson = imports.togeojson.togeojson;
 const Domparser = imports.xmldom.domparser;
 
@@ -36,7 +37,7 @@ class KmlShapeLayer extends ShapeLayer.ShapeLayer {
     }
 
     _parseContent() {
-        let s = this._fileContents.toString();
+        let s = Utils.getBufferText(this._fileContents);
         let parser = new Domparser.DOMParser();
         let json = Togeojson.toGeoJSON.kml(parser.parseFromString(s));
         this._mapSource.parse(json);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]