Hexagon Geospatial
MENU

Smart M.App

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

GeoJSON layers don't work correctly

[ Edited ]

For any geojson in a BI map, both placed manually or uploaded through a recipe, there seems to be a problem with the first entry: it does not display. For the ones manually placed via the m_app interface, this only happens when I try to hide and show the layer from the legend, in which case only the first parcel is hidden, and the rest remains. When I try to 'unhide' the layer again, the first parcel still remains hidden. For the shapes uploaded via a recipe, the first parcel does not display at all, but I can hide/unhide the other parcels (although they only lose their color). Here's what I'm talking about: 

 

 

The image in this case is a shape uploaded via a recipe. The first "parcel" does not display at all.

Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

Re: GeoJSON layers don't work correctly

Any update or idea regarding this?

Technical Evangelist
Posts: 1,101
Registered: ‎09-11-2015

Re: GeoJSON layers don't work correctly

Are you saying that even if you configure the BI Map manually using that GeoJSON data you miss the first rectangle? Can you please zip and attach that file to your reply?

 

Thanks,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

Re: GeoJSON layers don't work correctly

[ Edited ]

Yes. Although if I add the file manually, at first it appears to be fine, but if I attempt to change the visibility to hidden and back, it follows the above described course (only the first polygon is hidden, and then it doesn't come back). When I add them through the recipe, the features also hide the raster layer in the background, but the hide/show option works (aside from the first polygon). Nevertheless, it might just be a problem on my side, so I'll attach the two geojson files I tries to use:

 

The not-generated one

The generated one

 

Sorry for the advertising barrage on the site, but this is the way of file hosting websites (I have no idea how to attach a zip to the reply).

 

Edit: I have since created a new shapefile in IMAGINE and uploaded it to the chest. It has the same problem, and I double checked all the table values - they are fine. This is weird.

Technical Evangelist
Posts: 1,101
Registered: ‎09-11-2015

Re: GeoJSON layers don't work correctly

Hi Radu, this looks like a bug. I have reproduced that even on other BI Maps that I already have.

I will inform about that our development.

 

Thanks and sorry for the inconvenience.

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

Re: GeoJSON layers don't work correctly

Hello Jan. Thank you, and don't worry too much, bugs do happen, and from what I get the smart m.app platform is relatively new. Nevertheless, be sure to keep us up to date with the progress being made. 

 

Best regards, Radu

Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

Re: GeoJSON layers don't work correctly

Okay ,so, even though the recipe panel (still) doesn't work, I have hardcoded the id of a geojson and sent it with a message to a bi panel, and I have to say, the layer now displays just fine, and can be hidden/shown without problems. However, this is just temporary, until the recipe panels are fixed, and I don't know how the layers will act then.

Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

Re: GeoJSON layers don't work correctly

[ Edited ]

Okay, they now display fine. But upon adding them to the map, all layers change visibility to hidden (with the message "display failed"), and this also happens when resizing the panel. I'll look into this, see if I can find a workaround.

Frequent Contributor
Posts: 77
Registered: ‎10-12-2015

Re: GeoJSON layers don't work correctly

[ Edited ]

I can't seem to find any way to make the layers constantly work. Whenever a map contains a geojson layer, on tile load, zoom and panel resize all layers get disabled, and their legend entries show ("Display failed"). I have noticed that gsp.map.refresh() sometimes fixes them, but if I have two maps that (in my case) move simultaneously, it gets broken again (and besides, calling this every time a user moves the map is kind of annoying).

 

Edit: This is what the console tells me: 

 

 

Edit 2: This is the code that I use for the layer object:

 

var layerChoropleth = {
                    definitionName: "MAppPlatformGeoJson",
                    url: gj,
                    name: "Change",
                    id: "features",
                    bbox: [0, 0, 0, 0],
                    bboxCrs: "EPSG:4326",
                    supportedCrses: ["EPSG:4326", "EPSG:3857"],
                    style: {
                        display: "thematicLayer",
                    }
                };
Technical Evangelist
Posts: 132
Registered: ‎08-05-2015

Re: GeoJSON layers don't work correctly

I found that this behavior occurrs when the geometry ID has a "falsy" value (0, -1 or something that would return false when casted to boolean). It's already resolved on the development version.

 

As a workaround you could replace falsy IDs in the GeoJSON file with something that returns true when casted to boolean.

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.