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

#208 support for Lines between markers added to JVectorMap #431

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fdominik
Copy link

I have added support for creating lines between markers (or rather a points defined by Lat and Long). There is not much functionality (like creating Arcs), but styling of Lines and Line Labels works.
Lines can be defined as:

var lines = [
               {points: [[40.66, -73.56], [41.52, -87.37], [35.22, -80.84]], text:"first road"},
               {points: [[31.52, -87.37], [21.18, -157.49]], ,text: "second path"}

           ]

The best to test the functionality is to see lines.html page.

@selinafocus
Copy link

hi fdominik,
thank u for the pull supporting lines,but i have a problem about overlaying the lines on the shapefile below.
the shapefile(just called the base map) and the lines over are in the same coordinate system,
but how can i transform these at same time and so these can be displayed correctly?
thank u very much!

@fdominik
Copy link
Author

I am not really sure if I understand correctly.
If you need to redraw the lines (e.g. for some movement of the objects etc...), you can call repositionLines(), which is available
If you need some other transformation, the best would be some code example of what you are trying to achieve.

BTW.: I have an update to thus pull request, where I have added toggle switch next to zoom buttons to allow switching on/off the lines on the map. However I am still not satisfied with results (CSS is not my strongest skill) so I will push this later when I will resolve it.

@selinafocus
Copy link

thank u for you answer!
i didn't make my point. sorry~
i have two kinds of data ,one is polygon shapefile, the other is line shapefile.
this two files have the same coordinates(wgs1984),so the line is well displayed over the polygon,for example, the line is in the middle of the polygon.
but now i use the processor program transform the polygon and the line shapefiles into jvectormap format independently,so in the jvectormap object these two dismatched.
how can i get the Lat and Long of the points of the line that match the polygon well?

@gezichenshan
Copy link

@fdominik Thanks for your awesome work. The only problem is that it seems we can only set color for one line?

@fdominik
Copy link
Author

fdominik commented Jul 3, 2018

@gezichenshan oh indeed, I didn't have this in mind when doing it. I am thinking, is it already working anywhere in jvectormap? I think markers can also have only one color, am I right?
I am thinking how this can be realized, maybe adding a new property next to points, text, something like
{points: [[31.52, -87.37], [21.18, -157.49]], color: #ffffff, text: "second path"}
what do you think?
Also I have in my local repo stil a change to it to add UI controls to toggle on/off the lines. However I am not a graphic specialist and still it somehow doesn't look that perfectly like the other controls of jvectormap. So any help would be welcome :)

@fdominik
Copy link
Author

fdominik commented Jul 3, 2018

@selinafocus I am not sure about the transformation. I haven't used the processor transformation, maybe some unit tests would be nice to see where it doesn't work.
the true is there is probably no transformation for lines in the processor, because I have never used the processor yet, so I am not sure how it works.
Are you a developer who can take a deep look into it or rather a user of jvector map?

@gezichenshan
Copy link

@fdominik Thank you for your reply. Setting a new property "color" is a good choice. Anyway, maybe there is no need to set different color for different line. I am not good at graphic, either. May somebody can help :)

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

Successfully merging this pull request may close these issues.

4 participants