ThinkGeo.com    |     Documentation    |     Premium Support

Migrating from 4.5 to 12 Adornment Overlay

Hi Andras, we have it extended. Enjoy developing!

Frank
I try on Windows 10 our project. Things with sizes and offset the same as on Win 8.1
All the images on adornment layer bigger and shifted when scale in system set to 125
What we can to do to avoid this issue?
Thanks

Ben, thanks
After trying to run project on the my computer it forward me to [https://thinkgeo.com/pricing]
After trying to run project on the another computer it forward me to helpdesk.thinkgeo.com/register.
ProductCenter is runned and I login to it. There I see 23 days left. But I can not run project in Visual Studio. What I missing and what I should to do?
If I run without debuging

Frank,
The project crashes after a while. I am trying to understand the reason
I need to init map to stored extent and center on stored center point
I trying emulate it at the project. Please look on this. Is it correct way?
CustomAdornmentLayer.zip (22.3 KB)

Hi Andras,
Please remove everything in c:\ProgramData\ThinkGeo and start over.

A runtime license is needed if no debugger is attached. Make sure you regenerate the runtime license after the dev license got extended .

Ben

Hi Ben
I do all process from begining, after deleting ThinkGeo license folder
Result the same. I can not run under debuger. It forward me to register page
Same situation on two different PCs

After deleting the folder, please run product center and install the evaluation again from scratch. It should fix the licensing issue. Or we can have a Zoom Meeting and get to the bottom of it. I’m at Central Time and please let me know what a good time for you.

Ben,
I think could be nice if we have Zoom meeting
My time GMT + 2. Morning from 9:00 to 17:00 good time for me
Dont understand Central Time, GMT + 0?

It seems I’m 8 hours behind you. How about let’s meet at 16:00 your time tomorrow? So sending you the request to slava37mail@gmail.com?

Yes this mail, can we connect today by zoom? 18, 19 my time?

sure. how about 18:00? sending you the request.

Ok I waiting… No need lost time

Hi Andras,

Here are the explanations of how the system scale affects the adornment overlays.

  1. Everything is supposed to be bigger proportionally if the system’s scale is turned up. The higher scale is usually set for high-res screen, the resolution is so high so if everything will be too small if displayed as its original size. For example, iPhone’s screen scale is 300% (some of them are 200%) and that’s why all the images needs to x3 for properly displayed. Similarly if you are using a laptop with a high-res monitor on Windows, or use a 4k monitor, usually the scale is more than 100% to avoid the images being too small. A higher scale on a high res screen will make it look like “normal” size but sharper.

  2. Map Suite 4.5 didn’t respect the system Scale but version 12 does. This is an improvements we made in the later versions.

  3. In the code, if you check MapView1.ActualWidth, you will see this number gets smaller when the scale get bigger. For example if it is 800 when scale is 100%, the map with the same size will be 400 when the scale is 200%. This is because one virtual pixel now is as twice bigger as the old one once the scale doubled. So the map with the width of 800 pixels now becomes 400 pixels under 200%. Similarly the lengths of a 100px line doubled under 200% and this is why everything gets bigger.

  4. If you want to make the size of the image not respect the system’s scale, one quick way is to set the property of the executable to the following. But remember it will then be smaller than expected.

I hope it all make sense.

Thanks,
Ben

Ben
Thanks for meeting and solving my troubles with evaluation license
I am very glad that finally there was an understanding with adornment layer sizes and shifting, thanks to your explanation. I hope your team will make an option so that it can be set in the development environment and ignore system scale when the program is launched under a debugger. It seems shouldn’t be very difficult, but it will expand the possibilities.

Next issue, changes in ZoomLevelSet. I can not change scale less than 20. We need more accurcy and more detailed map view
Thanks

Andras,
Regarding the zoomlevelset. You could use the custom zoomset. Here is the sample

private void InitZoomLevels()
{
    ZoomLevelSet zoomLevelSet = new ZoomLevelSet();
    foreach (var zoomLevelScale in GetZoomLevels())
    {
        zoomLevelSet.CustomZoomLevels.Add(new ZoomLevel(zoomLevelScale));
    }
    _wpfMap.ZoomLevelSet = zoomLevelSet;
}

  public static List<double> GetZoomLevels()
{
    OpenStreetMapsZoomLevelSet osmZoomLevelSet = new OpenStreetMapsZoomLevelSet();
    List<double> zoomLevels = new List<double>();
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel03.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel04.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel05.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel06.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel07.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel08.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel09.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel10.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel11.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel12.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel13.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel14.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel15.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel16.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel17.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel18.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel19.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel20.Scale);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel20.Scale / 2);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel20.Scale / 4);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel20.Scale / 8);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel20.Scale / 16);
    zoomLevels.Add(osmZoomLevelSet.ZoomLevel20.Scale / 32);
    return zoomLevels;
}

Thanks

Frank

Hi Andras, I’ve added it to the list and we will review it later.

Thanks,
Ben

Frank, thanks. It works with scale less than 20 now
Next issue. I see changes with displaying Features

  1. In V12 very often happens situation when image of feature displayed cropped

Map turned and we can see quadrants, border of wich croppes the images.Same issue when map not turned. If image of feature is in two quadrants, displayed only part in one quadrant.
Can we avoid this issue some how?

2 We need rotate map, center map on the feature and pan Map that feature was in the bottom of the screen.
In 4.5 I do this such way

PointShape CenterPointShape = Doc.MainVehicle.CurrentPosition.GetPointShape() :
(PointShape)RotateProjection.ConvertToExternalProjection(Doc.MainVehicle.CurrentPosition.GetPointShape());
RectangleShape NewExtent = (RectangleShape)Map2.CurrentExtent.Register(Map2.CurrentExtent.GetCenterPoint(), CenterPointShape, DistanceUnit.Meter, GeographyUnit.Meter);
Map2.CurrentExtent = RotateProjection.GetUpdatedExtent(NewExtent);
Map2.Pan(PanDirection.Up, 30);
Map2RefreshDetailOverlay();

What is the right way doing that when I using MapView.Angle for rotation instead RotateProjection?

Thanks Andras,

  1. This because the items not draw in the next tile. You can set layer.DrawingMarginInPixel = 256 to have the next tile draw more area. This will avoid the cutting happen.
  2. You can use the same way you do before. We changed the “RotationProjection” to “RotationProjectionConverter”.Also you could rotate the whole mapview byt set mapView.RotatedAngle . Here is the sample to show you how to center the vehicle on the map. You need get the direction of the vehicle and calculate the correct angle for the mapView.RotatedAngle.

By the way. We could always open a new post threading for new question. This could be easier for us to track the issue.

Thanks

Frank

Frank, thanks
1 With tiles Ok
2. With shifting vehicle to bottom of the screen
I tried do same way as it was in 4.5
Program turn the map, center it on vehicle. It is Ok
Next step, I need to shift turned map, to down, so that my vehicle will be placed in the bottom part of screen. Also I need to rotate map by mapView.RotatedAngle that background image also was turned, how we discused early
If I do Map2.Pan(PanDirection.Up, 30); now, the map is shifted towards the south. And vehicle is anywhere instead of down. Seems,I should shift it at map turn angle direction but I don’t know how it can be done

Thanks Andras,
You could do this way

private void PanArrow_Click(object sender, RoutedEventArgs e)
{
    var percentage = (int)panPercentage.Value;
    switch (((Button)sender).Name)
    {
        case "panNorth":
            mapView.Pan(GetAngle(0f - mapView.RotatedAngle), percentage);
            break;
        case "panEast":
            mapView.Pan(GetAngle(90 - mapView.RotatedAngle), percentage);
            break;
        case "panWest":
            mapView.Pan(GetAngle(270 - mapView.RotatedAngle), percentage);
            break;
        case "panSouth":
            mapView.Pan(GetAngle(180 - mapView.RotatedAngle), percentage);
            break;
    }
}

private float GetAngle(float ang)
{
    return ang < 0 ? ang + 360 : ang; 
}

Thanks

Frank