[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - A new park?

A new park?

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

A new park?

Postby FletcherJ » Fri Jan 27, 2012 4:32 pm

Greetings,

I am playing with the code to create a polygon on page 191 of the manual. I type it in per the manual (except I am using C#). Now the manual has an example, but doesn't say what to expect. What I get is a triangle that stretches from a point between Nebraska and Kansas to a point about 30 miles east of Cincinnati to a 3rd point off the coast of Africa. Given that the example has more than 3 points, I was zooming in on the points to see if there might be multiple points. When I choose the 3rd point off the coast of Africa (about 000d 17' 44", -0d 11'47" with a zoom of 5 mi, (open ocean), what showed up but:

"Whiskytown Shasta Trinity National Recreation Area"

Now I might be mistaken, but I could have sworn that this is a National Park in Northern CA, near the city/country of Shasta. Not quite sure how it ended up out off the coast of Gabon/Ghana (heck Somlia is on the East coast of Africa, so I know it wasn't stolen by the Somalian pirates....) I am only using the 01, 05, and US data sources.

So my question is:
1) Why, when I follow the example on page 191 for .CAD.Polygon(points, long):CadObject do I get a triangle stretching across the US and down to Africa (is this really what I should be seeing?)
2) How did a National Park end up off the coast of Africa?

Thanks,

me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: A new park?

Postby David.Trecht » Fri Jan 27, 2012 7:25 pm

I have found similar issues with many of the samples they have in their book. I know they are just samples, but many of them just don't work :-(
User avatar
David.Trecht
New User
New User
 
Posts: 1
Joined: Fri Jan 27, 2012 10:20 am

Re: A new park?

Postby ROstmeyer » Fri Jan 27, 2012 9:12 pm

David.Trecht wrote:I have found similar issues with many of the samples they have in their book. I know they are just samples, but many of them just don't work :-(

It appears to work fine for me! The code on that page, as the OP suggested, is VB.Net. If one types the code as is in VB-NET (VS-2010), which I just did, the program works runs fine and creates two triangles, as expected. Can't be sure what exactly the OP typed in, when he tried it in C#, and I am not as familiar with C#, but if one translates the code correctly to C# or any other language, it has to work. It can't be working in one language, but not in the other.
User avatar
ROstmeyer
Active User
Active User
 
Posts: 16
Joined: Thu Aug 18, 2011 11:26 am

Re: A new park?

Postby CraigWY » Fri Jan 27, 2012 9:28 pm

FletcherJ wrote:I am playing with the code to create a polygon on page 191 of the manual. I type it in per the manual (except I am using C#).

If you "type it per the manual" it won't work, since you are using C# but the code shown is in VB.

FletcherJ wrote:1) Why, when I follow the example on page 191 for .CAD.Polygon(points, long):CadObject do I get a triangle stretching across the US and down to Africa (is this really what I should be seeing?)

You must be doing something wrong. In particular if you are typing VB code in the C# environment, as you said above and you expect it to work.
User avatar
CraigWY
Casual User
Casual User
 
Posts: 12
Joined: Mon Feb 21, 2011 9:35 am

Re: A new park?

Postby BobPark » Fri Jan 27, 2012 10:40 pm

FletcherJ wrote:I am playing with the code to create a polygon on page 191 of the manual. I type it in per the manual (except I am using C#). Now the manual has an example, but doesn't say what to expect.

FletcherJ, can you post a copy of the C# code as you typed it in?
User avatar
BobPark
New User
New User
 
Posts: 9
Joined: Fri Jan 27, 2012 10:29 am

Re: A new park?

Postby UShadow » Sat Jan 28, 2012 9:42 am

FletcherJ wrote:1) Why, when I follow the example on page 191 for .CAD.Polygon(points, long):CadObject do I get a triangle stretching across the US and down to Africa (is this really what I should be seeing?)


You must be typing something wrong. The following code (which is the C# equivalent of what is given on pg 191), works with no problems in VS-20120, C#. I just typed in in, no problems at all. Regarding the park in Africa, it must be a data error, you should probably contact undertow and let them know.

Code: Select all
      private void menuItem86_Click_1(object sender, EventArgs e)
        {
            MapPro80.TrPoint[]  Tpt= new MapPro80.TrPoint[20];
            MapPro80.CadObj Tpg1, Tpg2;
            // Define some points to be used for polygons
            Tpt[1].x = -100;
            Tpt[1].y = 40;
            Tpt[2].x = -100;
            Tpt[2].y = 50;
            Tpt[3].x = -88;
            Tpt[3].y = 32;
            Tpt[4].x = -96;
            Tpt[4].y = 38;
            Tpt[5].x = -84;
            Tpt[5].y = 39;
            Tpt[6].x = -80;
            Tpt[6].y = 38.5;
            Tpt[7].x = -85;
            Tpt[7].y = 34;
            // Draw Polygon with first 4 Points
            Tpg1 = axMapPro1.Cad.Polygon(ref Tpt[1], 3);
            Tpg1.Pen.width = 2;
            Tpg1.Pen.Color = ColorTranslator.ToOle(Color.Red);
            Tpg1.Brush.Color = ColorTranslator.ToOle(Color.Blue);
            //  Draw a second polygon with Points 5, 6, and 7
            Tpg2 = axMapPro1.Cad.Polygon(ref Tpt[5], 3);
            Tpg2.Pen.width = 1;
            Tpg2.Pen.Style = 2;
            Tpg2.Pen.Color = ColorTranslator.ToOle(Color.Green);
            Tpg2.Brush.Color = ColorTranslator.ToOle(Color.Red);
            axMapPro1.Refresh();
        }
Imagination is greater than detail - Albert Einstein
User avatar
UShadow
Frequent User
Frequent User
 
Posts: 61
Joined: Fri May 28, 2010 11:49 am

Re: A new park?

Postby Gyrotech » Sun Jan 29, 2012 9:53 pm

Ushadow, if I had to guess, I'd say FletcherJ did everything right, when converting the VB code to C#, with the exception of passing the points to the CAD function by "ref". He probably didn't do that :-)

I'd be very interested in knowing if that's what happened. FletcherJ, can you tell us if that was the problem?
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: A new park?

Postby FletcherJ » Mon Jan 30, 2012 4:42 am

Gyrotech,

Congratulations, you nailed it. Just missing the "ref" statements.

Now I am just curious about why there is a U.S. national park at lat/lon 0,0....

Thanks,

me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: A new park?

Postby BobPark » Mon Jan 30, 2012 10:32 am

FletcherJ wrote:Now I am just curious about why there is a U.S. national park at lat/lon 0,0....

That sounds like a data problem. Have you reported it to undertow?
User avatar
BobPark
New User
New User
 
Posts: 9
Joined: Fri Jan 27, 2012 10:29 am

Re: A new park?

Postby FletcherJ » Mon Jan 30, 2012 2:46 pm

Bob,

So they don't monitor the forums? Should I just send an email to support pointing them to the forum message? Or is there a reporting system that I have overlooked?

Thanks,

me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: A new park?

Postby BobPark » Mon Jan 30, 2012 6:09 pm

I don't think they do. I believe this was setup for us users to exchange ideas. I have emailed them directly a couple of times in the past, and they have been very responsive!

Oh, yeah, I emailed them at support@undertowsoftware.com
User avatar
BobPark
New User
New User
 
Posts: 9
Joined: Fri Jan 27, 2012 10:29 am

Re: A new park?

Postby FletcherJ » Tue Jan 31, 2012 2:08 pm

BobPark wrote:I don't think they do. I believe this was setup for us users to exchange ideas. I have emailed them directly a couple of times in the past, and they have been very responsive!

Oh, yeah, I emailed them at support@undertowsoftware.com


Bob,

Thanks, they have now been officially notified of the new park in the oceans off Africa.
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: A new park?

Postby mAlagi » Mon Feb 06, 2012 1:59 pm

Happy to report that the latest build on the OCX on their public page doesn't show any parks in the middle of the ocean :-)
"640K ought to be enough for anybody." - Bill Gates, 1981
User avatar
mAlagi
Active User
Active User
 
Posts: 28
Joined: Fri Aug 12, 2011 11:09 am


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 1 guest

cron