Map Wrapping
-
I orginally posted this in the C# form (the language I am trying to write this in) and recieved no responses :( . Thought I would try here before giving up. I am trying to allow wrapping of a world map from east to west or west to east (the map is split down the Pacific Ocean). Thus the map would appear to be a cylinder not a rectangle. As the user scrolls across the dividing line the other map edge appears. I thought this would be resonable but I have not been able to find much searching (map, warpping and scrolling appear in many contexts). Any help would be greatly appericated. Thanks, Jim
this thing looks like it was written by an epileptic ferret Dave Kreskowiak
-
I orginally posted this in the C# form (the language I am trying to write this in) and recieved no responses :( . Thought I would try here before giving up. I am trying to allow wrapping of a world map from east to west or west to east (the map is split down the Pacific Ocean). Thus the map would appear to be a cylinder not a rectangle. As the user scrolls across the dividing line the other map edge appears. I thought this would be resonable but I have not been able to find much searching (map, warpping and scrolling appear in many contexts). Any help would be greatly appericated. Thanks, Jim
this thing looks like it was written by an epileptic ferret Dave Kreskowiak
-
Yes, I want to apply a Mercator Projection but I don't think I was clear with my orginal question, I'll try again. Only part of the map is visible at any given time. What happens when the user reaches the left/right edge of the map in order to see more they must scroll to the opposite edge. Similar to a huge mercator projection painted on a 500 foot long sheet of paper lying flat on the ground. You reach the end of the paper and if you want to see more of the map you have to go back to the other edge (what I have now). If what you are interested in is over or close to the split you are always going back and forth. Now picture that same map on cyclinderical tower which has a 500 foot diameter. The two edges of the map meet and you don't have to go back and forth (what I want to have). I have attempted to do this by using an oversized map (shows 380 degrees of longtitude when viewed completely) and resetting the X location. I haven't been able to get this to work. Any ideas? Jim
this thing looks like it was written by an epileptic ferret Dave Kreskowiak
-
Yes, I want to apply a Mercator Projection but I don't think I was clear with my orginal question, I'll try again. Only part of the map is visible at any given time. What happens when the user reaches the left/right edge of the map in order to see more they must scroll to the opposite edge. Similar to a huge mercator projection painted on a 500 foot long sheet of paper lying flat on the ground. You reach the end of the paper and if you want to see more of the map you have to go back to the other edge (what I have now). If what you are interested in is over or close to the split you are always going back and forth. Now picture that same map on cyclinderical tower which has a 500 foot diameter. The two edges of the map meet and you don't have to go back and forth (what I want to have). I have attempted to do this by using an oversized map (shows 380 degrees of longtitude when viewed completely) and resetting the X location. I haven't been able to get this to work. Any ideas? Jim
this thing looks like it was written by an epileptic ferret Dave Kreskowiak
Hi, I don't see where the problem could be (unless you hope to solve this with a PictureBox :-D ). Here are some thoughts, they may not be optimal, just intended to show a possible way: 1. if you have an image of the world (say from longitude 0 to long 360), then you need to paint it in two steps, first from your starting longitude x0 upto 360, then from 0 to the right border (x0 again). So calling some overload of Graphics.DrawImage twice should do it. An altenative is to construct a double-sized image once (that is from 0 to 360 and again from 0 to 360) and then paint the right part of it. 2. if you are drawing the world yourself, you can draw it in the regular way, you only need to adjust the x coordinate and again tranform the longitudes [0,360) to [x0...360, 0...x0). This by itself could be handled by modifying all x coordinates; or more easily by having your paint code execute twice, once with a translation that takes care of the left part so [0, x0) gets clipped of at the left, and once with a translation that takes care of the right part so [x0, 360) gets clipped of at the right. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
-
Hi, I don't see where the problem could be (unless you hope to solve this with a PictureBox :-D ). Here are some thoughts, they may not be optimal, just intended to show a possible way: 1. if you have an image of the world (say from longitude 0 to long 360), then you need to paint it in two steps, first from your starting longitude x0 upto 360, then from 0 to the right border (x0 again). So calling some overload of Graphics.DrawImage twice should do it. An altenative is to construct a double-sized image once (that is from 0 to 360 and again from 0 to 360) and then paint the right part of it. 2. if you are drawing the world yourself, you can draw it in the regular way, you only need to adjust the x coordinate and again tranform the longitudes [0,360) to [x0...360, 0...x0). This by itself could be handled by modifying all x coordinates; or more easily by having your paint code execute twice, once with a translation that takes care of the left part so [0, x0) gets clipped of at the left, and once with a translation that takes care of the right part so [x0, 360) gets clipped of at the right. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
Thanks for your help. Jim
this thing looks like it was written by an epileptic ferret Dave Kreskowiak
-
Thanks for your help. Jim
this thing looks like it was written by an epileptic ferret Dave Kreskowiak
You're welcome. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets