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

top (lat>85) and left (lon<-175) not visible #308

Closed
hummingbird-dev opened this issue Sep 12, 2017 · 16 comments
Closed

top (lat>85) and left (lon<-175) not visible #308

hummingbird-dev opened this issue Sep 12, 2017 · 16 comments
Labels

Comments

@hummingbird-dev
Copy link

Thanks for that great plugin. I started to play around with Mapael and found that points plotted far left (approx. <-175) and at the top (approx. >85) are not visible (see figure, where less than the half of the large points is visible).
Sure, I can change the viewBox of the svg like $(".map_container").find("svg").attr("viewBox", "-40 -30 1030 530"); which will solve this problem. But this introduces new problems, e.g. with the zoom.
Thus I would like to ask if it is possible to have a full view of the map from -180 to 180 and -90 to 90?
Thanks.
mapael_boundary_test

@neveldo
Copy link
Owner

neveldo commented Sep 21, 2017

Hi @hummingbird-dev ,

You pointed out an interesting issue. For now, the only answer I have should be to modifiy the original map in order to add these margins, ie :

1 / Transform the JS map to SVG map (through the mapael to SVG convertor : https://www.vincentbroute.fr/mapael/svg-to-mapael.php )
2 / With inkscape, add the margins all around the map
3 / Transform the SVG map back to a JS map : https://www.vincentbroute.fr/mapael/mapael-to-svg.php
4 / Adjust the getCoords() function to take into account the new top and left offsets.

I know this is not a trivial solution, but it should do the work, I'm still seeking for a better one, but feel free to contribute if you get it !

@hummingbird-dev
Copy link
Author

Hi,
Thanks for the answer. I will try your solution and let you know if it worked.

@Indigo744
Copy link
Collaborator

@hummingbird-dev did you manage to do it? Or do you need more help?

@Indigo744 Indigo744 added the map label Oct 12, 2017
@hummingbird-dev
Copy link
Author

Unfortunately I was not able to try it yet, I'm quite busy at the moment with some other stuff. However, as soon as will find time I will try it and let you know.

@Indigo744
Copy link
Collaborator

Can you explain me the need for such a thing? Do you want to plot something at the map limit?

@hummingbird-dev
Copy link
Author

Yes, I'm using the jQuery-Mapael maps to plot scientific data taken during ship expeditions on the global oceans. This includes the Arctic, Antarctica as well as regions near the International Date Line.

@Indigo744
Copy link
Collaborator

Alright. So maybe you should use a world map with Antarctica shown? Like this one or this one would be better.

Mercator projection should obviously be avoided, as it has issue with poles...

@Indigo744
Copy link
Collaborator

If I can find some time today, I'll try to import one of these map into Mapael.

@hummingbird-dev
Copy link
Author

Thanks a lot, that would be great. However, I think the "world_countries" map, I'm using, is not a Mercator projection. It looks rather like the equirectangular projection you sent in the first link. Anyway, an equirectangular projection from -180 to 180 and -90 to 90 would be perfect.
Thanks again.

@Indigo744
Copy link
Collaborator

See the PR neveldo/mapael-maps/pull/43

@hummingbird-dev
Copy link
Author

Wow, thank you very much.

@Indigo744
Copy link
Collaborator

Thank you :) hope this helps

@hummingbird-dev
Copy link
Author

I've implemented the new map and it works like a charme (see figure).
image

@Indigo744
Copy link
Collaborator

Well, I don't quite understand what I'm seeing but I'm glad it helps you ;-)

@Indigo744
Copy link
Collaborator

@hummingbird-dev for your information, the map world_countries_with_antarctica.js was renamed to world_countries_with_antarctica_full_long_and_lat.js (see PR neveldo/mapael-maps#44)

@hummingbird-dev
Copy link
Author

Thanks.

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

No branches or pull requests

3 participants