Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1 geometry MultiLineString, LineString #21

Open
l3eware opened this issue Jul 28, 2021 · 4 comments
Open

1.1 geometry MultiLineString, LineString #21

l3eware opened this issue Jul 28, 2021 · 4 comments

Comments

@l3eware
Copy link

l3eware commented Jul 28, 2021

Hi,
in my geoJson string I have some MultilineString geometry. But when I am generating JsObject:
(JsObject) Global.JSON.parse(jsonString);
Something is wrong. Am I missing something? When I have Multipolygon It is ok...
Thanks

@zak905
Copy link
Member

zak905 commented Aug 1, 2021

Hello @l3eware, multiline string is working for me, I just added an example branch in the gwty-leaflet-starter-guide repo, checkout https://github.com/gwidgets/gwty-leaflet-starter-guide/blob/geogson_multilinestring/src/main/java/com/gwidgets/leaflet/client/GwtyLeafletStarter.java#L145

are you using the latest 1.1 version ?

@l3eware
Copy link
Author

l3eware commented Aug 1, 2021

Hi zak905, thanks you for reply I am going to try it and find whats wrong in my code.
I am getting geojsons from DB - polygons or lines. But Lines dont work. I am doing somethink wrong.
Please is it any way how to debug what can be wrong?
If I put polygon firstly geoJsonPolygon.addto(map); and then I want to add simple circle.addto(map), it didnt draw circle.
If I add first circle it draws it.
Or If I want with checkbox add or remove polygons. Every time when adding (checkbox goes true) I change color of polygons. It works But I think always new layer is added and hiding old. If the checkbox is unchecked -remove from map is not working. Please If is way how tu easily understand whats wrong or debug, tell me. Thanks you

@zak905
Copy link
Member

zak905 commented Aug 3, 2021

are you getting any messages in the browser console ? It's possible to debug GWT java code in the browser using source maps (checkout http://www.g-widgets.com/2017/06/29/quick-tip-debugging-a-gwt-application-using-chrome-dev-tools/) . They are enabled by default in dev mode. However, if the error happens in Leaflet.js side, I think it would be better to work out a small example in javascript first and then convert the code to Java when the issue is resolved

@l3eware
Copy link
Author

l3eware commented Aug 3, 2021

zak905 a lot of thanks for help and your time.

I would be grateful if you could add an example how to use (for my GeoJSON object) function .eachLayer(Function function, JsObject jsObject) in java?
For example If my GeoJSON is FeatureCollection and I want to change fillColor for every Polygon - Feature/Layer or BindPopup.
Or the way how to use geoJSONOptions.onEachFeature - this goest trought all layers and gson.eachLayer also go trough all layers?

Anyway thanks a lot... I have to study more to understand this all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants