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



commit c39bda5fd3748b55709ea702824cf93ec0427d3f
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]