GEOJSON problem with some LineString properties

Hello.
I can import this GeoJSON file, except if i insert any of these 2 properties to the LineString:
"stroke": " #9e207e" or "stroke-width": 4
In this case, appinventor give this error: "An internal error has occurred. Report a bug?"

In http://geojson.io/ it works fine.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {"name": "Track", **"stroke": " #9e207e", "stroke-width": 4**},
      "geometry": {"type": "LineString","coordinates": 
        [
          [ -0.9039044380187988,  41.65768354783612],
          [ -0.8924245834350586,  51.65402822668345]
        ]}
    },
    {
      "type": "Feature",
      "properties": {"marker-color": "#7e007e",  "marker-size": "medium",  "marker-symbol": "",  "name": "ZombieBoy" },
      "geometry": { "type": "Point",  "coordinates": [-0.8945703506469727,  41.6551184318944]}
    }
]
}

Please read http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/components/maps.html#FeatureCollection ,
specifically

FeatureFromDescription( description )

Converts a feature description into an App Inventor map feature. Points are converted into Marker components, LineStrings are converted into LineString components, and Polygons (and MultiPolygons) are converted into Polygon components. If the feature has properties, they will be mapped into App Inventor properties using the following mapping:

  • description becomes Description
  • draggable becomes Draggable
  • infobox becomes EnableInfobox
  • fill becomes FillColor
  • fill-opacity becomes FillOpacity
  • image becomes ImageAsset
  • stroke becomes StrokeColor
  • stroke-opacity becomes StrokeOpacity
  • stroke-width becomes StrokeWidth
  • title becomes Title
  • visible becomes Visible

and edit the geojson file you have appropriately and see if that fixes your issue Patricio.
Does editing the geojson allow you to display the LineString? I am fairly certain you have to use RGB colors, not #9e207e format

Regards,
Steve

Hi Steve.
I modified the geojson file, but the same issue happens. Is this what to ask me to try?
Regards,

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {"StrokeColor": "#7e007e"},
"geometry": {"type": "LineString","coordinates":
[
[ -0.9039044380187988, 41.65768354783612],
[ -0.8924245834350586, 51.65402822668345]
]}
},
{
"type": "Feature",
"properties": {"marker-color": "#7e007e", "marker-size": "medium", "marker-symbol": "", "name": "ZombieBoy" },
"geometry": {"type": "Point", "coordinates": [-0.8945703506469727, 41.6551184318944]}
}
]
}

Close but not it. Try "StrokeColor": "126, 0, 126 "},

#7e007e is the hex color; 126, 0, 126 is the equivalent RGB color. The LineString color has to be a RGB 'color' .

Will it work? I do not know. Try it. If that does not work, you may have discovered a bug or an error in the documentation. You could also try "Stroke": "126, 0, 126 "},

1 Like