You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've seen issues when importing some .kml-files, and we've narrowed down the files prone for errors to files containing features which are imported with the KML-parser as geometryCollections.
I checked the code and sure enough, geometryCollections are not supported in the tanslateImportedFeature-method.
Proposed suggestion:
Create a new model in Core that can be used trough out the application. The model should implement methods that are often used when dealing with kml. So far, the following methods have been implemented:
parseFeatures(kmlString, settings):
Accepts a KML-string and tries to parse it to OL-features. Returns an object containing {features: <Array of OL-features>, error: <String with error message || null> }. The optional settings-object accepts a prepareForMapInjection <bool> (defaults to true) parameter, stating if the features should be transformed so that they can be easily added to the map.
import(kmlString, settings):
Accepts a KML-string and adds the KML-features to the layer. Returns an object containing {status: <string>, error: <String with error message || null> }. The optional settings-object accepts a zoomToExtent <bool> (defaults to true) parameter, stating if the map view should be fit to the extent of the features in the current kml-source.
export():
Exports all features in the current kml-source.
removeImportedFeatures():
Removes all imported features from the current kml-source.
zoomToCurrentExtent():
Zooms the map to the current extent of the kml-source.
setLayer(layerName):
Accepts a string containing a layer name. Will set the current kml-source and layer.
getCurrentLayerName():
Returns the name of the vectorLayer that is currently connected to the model.
getCurrentExtent():
Returns the current extent of the current kml-source.
Any thoughts on more functionality?
The text was updated successfully, but these errors were encountered:
We've seen issues when importing some .kml-files, and we've narrowed down the files prone for errors to files containing features which are imported with the KML-parser as
geometryCollections
.I checked the code and sure enough,
geometryCollections
are not supported in thetanslateImportedFeature
-method.Proposed suggestion:
Create a new model in Core that can be used trough out the application. The model should implement methods that are often used when dealing with kml. So far, the following methods have been implemented:
parseFeatures(kmlString, settings)
:{features: <Array of OL-features>, error: <String with error message || null> }
. The optional settings-object accepts aprepareForMapInjection <bool>
(defaults to true) parameter, stating if the features should be transformed so that they can be easily added to the map.import(kmlString, settings)
:{status: <string>, error: <String with error message || null> }
. The optional settings-object accepts azoomToExtent <bool>
(defaults to true) parameter, stating if the map view should be fit to the extent of the features in the current kml-source.export()
:removeImportedFeatures()
:zoomToCurrentExtent()
:setLayer(layerName)
:getCurrentLayerName()
:getCurrentExtent()
:Any thoughts on more functionality?
The text was updated successfully, but these errors were encountered: