0

I have used the demo project for the MapControl and altered it to my needs.

This works so far. Now I want to repeat this in my actual project and I have copy & pasted all the code and everything is exact the same as in the altered demo project but in the actual project the MapControl shows nothing, only a gray background.

There are no errors.

The only thing I see on the MapControl is the mouse pointer changing when I click on it.

I even copy & pasted the MapControl but still no map is shown.

I can execute code to put items on the map, I get no errors but I can't see anything.

I can execute code to calculate a route and it returns the correct information but I can't see anything.

How is it possible that the MapControl works perfectly in one application and not in another?

Can anybody give me a clue in what direction to search for this?

I posted this problem on DevExpress forum also but unlike usually it stays quiet there...

EDIT:
I removed the Copy/Pasted MapControl from the form and started from scratch.
But the result is the same. I get no errors and calculating a route returns correct values, but the map still is too shy and refuses to show itself.

EDIT 2:
I created a new Bing Key but the result is the same, no errors but also no maps visible

EDIT 3:
I added a MiniMap and after entering the Bing Key the mini maps shows a map on design time
But on runtime its all gone again

Found the reason finally

I finally got it working. In the actual project all forms are derived from a base form This base form has this overriden method

protected override CreateParams CreateParams
{
    get
    {
        var cp = base.CreateParams;
        cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
        return cp;
    }
}

When I comment out this code the map finally shows up. Now I need to figure out why this code is there and if its really needed how I can keep it and still see the map

GuidoG
  • 11,359
  • 6
  • 44
  • 79
  • Downvoters please feel free to comment, sure you must have a reason for it so share it so I can learn from my mistake – GuidoG Jul 18 '18 at 12:01
  • Basically the whole question was filled with errors. See my edit. – ViRuSTriNiTy Jul 18 '18 at 13:32
  • I assume you are missing a step when just copy & pasting. Perhaps you should go through the [Getting started](https://documentation.devexpress.com/WindowsForms/15051/Controls-and-Libraries/Map-Control/Getting-Started) guide to start from scratch in your actual project. – ViRuSTriNiTy Jul 18 '18 at 13:36
  • @ViRuSTriNiTy Yes I already did that and removed the pasted MapControl and started from scratch. But with the same results. No errors but also no map visible. – GuidoG Jul 18 '18 at 13:57
  • I cannot resist `but the map still is too shy and refuses to show itself` is just funny. Did you customize the `ImageProvider` properly as described in step 3? Perhaps you have an invalid API key. – ViRuSTriNiTy Jul 18 '18 at 14:14
  • @ViRuSTriNiTy No I did not custimoze the `ImageProvider` because its not done in their demo project either. I started from one of the demo projects and altered that to my needs. Do you have a link to these steps so I can check if there is anything I missed – GuidoG Jul 18 '18 at 14:19
  • As i already wrote, dig through the [Getting Started](https://documentation.devexpress.com/WindowsForms/15051/Controls-and-Libraries/Map-Control/Getting-Started) guide and start with lesson one. In there you will find step 3 which shows how to setup the `ImageProvider`. – ViRuSTriNiTy Jul 18 '18 at 14:21
  • @ViRuSTriNiTy OK I will do that right now – GuidoG Jul 18 '18 at 14:21
  • @ViRuSTriNiTy I did all these steps before, but did them again just to be sure. Still no map is showing and still also no errors – GuidoG Jul 18 '18 at 14:25

0 Answers0