예제 #1
0
        public MapForm(ApplicationForm owner)
        {
            // set the owner form
            this.owner = owner;

            InitializeComponent();

            // initialize the map
            formsMap1.XMapUrl = "https://xmap-eu-n-test.cloud.ptvgroup.com/xmap/ws/XMap";
            formsMap1.XMapCredentials = "xtok:561677741926322";

            // This event-listener will create a reference from the map-control to the form.
            // So if the objects of the map aren't freed properly, the form will also leak memory.
            formsMap1.ViewportEndChanged += formsMap1_ViewportEndChanged;

            // go to Karlsruhe
            formsMap1.SetMapLocation(new Point(8.5, 49), 8);

            // add a new Shape Layer
            layer = new ShapeLayer("MyShapes");
            formsMap1.Layers.Add(layer);

            // this will create a memory leak if not properly deatch on finalization!
            owner.AddTruckButton.Click += button2_Click;
        }
예제 #2
0
        public MapForm(ApplicationForm owner)
        {
            // set the owner form
            this.owner = owner;

            InitializeComponent();

            // initialize the map
            formsMap1.XMapUrl         = "https://xmap-eu-n-test.cloud.ptvgroup.com/xmap/ws/XMap";
            formsMap1.XMapCredentials = "Insert your xToken here";

            // This event-listener will create a reference from the map-control to the form.
            // So if the objects of the map aren't freed properly, the form will also leak memory.
            formsMap1.ViewportEndChanged += formsMap1_ViewportEndChanged;

            // go to Karlsruhe
            formsMap1.SetMapLocation(new Point(8.5, 49), 8);

            // add a new Shape Layer
            layer = new ShapeLayer("MyShapes");
            formsMap1.Layers.Add(layer);

            // this will create a memory leak if not properly detach on finalization!
            owner.AddTruckButton.Click += button2_Click;
        }