Skip to content

Is there a way to use a custom map in a geoplot? #145

Answered by alandefreitas
lubeskih asked this question in Q&A
Discussion options

You must be logged in to vote

The geographic functions usually call geoplot(), which ensures the figure has a map in it, or creates a map otherwise by calling the world_map_110m() which returns the map points. Everything else is just calling the line plot functions to draw the map.

So if you have your own map, all you need to do is bypass these points and call plot with your own points instead. Something like:

        auto [x, y] = your_own_vector_map();
        line_handle a = ax->plot(x, y);
        a->tag("map");
        color_array land_color = {0, 0.9294, 0.9294, 0.9294};
        a->color(land_color);
        a->fill(true);
        color_array bg = {0, 0.7882, 0.7882, 0.7882};
        ax->color(bg);

        ax->x…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lubeskih
Comment options

Answer selected by lubeskih
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants