in reply to Re: Animated 2d Map
in thread Animated 2d Map

This is a really low level approach. I'd rather not have to write code to do map projections and cartographic to cartesian conversions myself.

p.s. Why exactly am I being downvoted here? The question is how to easily draw moving things on a map and what's suggested here is basically a roll-your-own map api solution. I may end up doing it, but I can't believe all the low level work of handling mercator projections etc. is justified. There must be an easier way.

Replies are listed 'Best First'.
Re^3: Animated 2d Map
by zentara (Cardinal) on Jan 29, 2010 at 13:03 UTC
    I'd rather not have to write code

    I wasn't the one downvoting you, i think it's a good question.

    But if you don't want to write your own code, you might want to use Google maps. They have an API, google for "google maps api", and/or you can look at the modules for GD maps at maps

    To give you are jump start on how to write your own code, I included a flying plane example above. What you do, is load your map, then use the following code from above, to trace out the path you want, by dragging the mouse along on the map, saving the points into an array of pathpoints, and stuff those into hashes, so:

    my $p = $lines{$count}{'line'}->get('points'); # print "@$p\n";
    you would end up with a hash full of path data, like
    $hash{'route1'} = @$p; # holds the pathpoints for route1
    Then, instead of making the plane follow a circle, as i did, make it follow your path for route1

    Its a pretty simple idea, but you need to sit down and write some code, or at least think about it some.... otherwise use software from others who have..... its not simple to do correctly.

    See IBM developer maps perl gd

    and

    IBM developer maps


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku