ThinkGeo.com    |     Blog    |     Wiki    |     Support

GoogleMap background display issue

Hi,

We changed thinkgeo version in our projects from 10.2.4 to 10.4.4
And there is a problem when displaying the google background from a certain zoom level.
At Zoom13 level, the display is OK.
For zoom level 14 and beyond, the display is no longer correct. (ie. screen shot)
For version 10.2.4, I have no problem, the google layer is displayed well.

Thanks

Regards.
Steph.20190312_Thinkgeo.zip (270.6 KB)

Hi Steph,

I build a very simple sample, and upgrade the package to MapSuiteDesktopForWpf-BareBone 10.4.4. All other packages also upgrade to latest release version. And the result as below:

Here is my test code:

        map.MapUnit = GeographyUnit.Meter;

        GoogleMapsOverlay g = new GoogleMapsOverlay("your client id", "your private key");
        map.Overlays.Add(g);

        map.CurrentExtent = new RectangleShape(-2000000, 2000000, 2000000, -2000000);
        map.Refresh();

I guess your problem is related with cache if you used it, or you can modify the simple code to reproduce the problem.

Regards,

Ethan

Hi Ethan,

The problem occurs in our projects because the scales are redefined.

The following code creates the problem:

   private void Map1_Loaded(object sender, RoutedEventArgs e)
    {
        try
        {
            Map1.MapUnit = GeographyUnit.Meter;

            var g = new LayerOverlay();
            var layer = new GoogleMapsLayer();
            layer.SendingWebRequest += Layer_SendingWebRequest;
            g.Layers.Add(layer);

            Map1.Overlays.Add(g);

            **OutilsOvLyr.CustomScaleZoomLevel(Map1.ZoomLevelSet);**

            Map1.CurrentExtent = new RectangleShape(-2000000, 2000000, 2000000, -2000000);
            Map1.Refresh();
        }
        catch (Exception ex)
        {
            _logger.Info(ex.Message);
            _logger.Info(ex.StackTrace);
            _logger.Info(ex.InnerException);
        }
    }
	
	
	        /// <summary>
    /// Paramètre la valeur de l'échelle pour chacun des zooms
    /// </summary>
    /// <param name="zoomLv"></param>
    internal static void CustomScaleZoomLevel(ZoomLevelSet zoomLv)
    {
        zoomLv.ZoomLevel01.Scale = Math.Round(4613998.359375, 10);
        zoomLv.ZoomLevel02.Scale = Math.Round(zoomLv.ZoomLevel01.Scale / 2, 10);
        zoomLv.ZoomLevel03.Scale = Math.Round(zoomLv.ZoomLevel02.Scale / 2, 10);
        zoomLv.ZoomLevel04.Scale = Math.Round(zoomLv.ZoomLevel03.Scale / 2, 10);
        zoomLv.ZoomLevel05.Scale = Math.Round(zoomLv.ZoomLevel04.Scale / 2, 10);
        zoomLv.ZoomLevel06.Scale = Math.Round(zoomLv.ZoomLevel05.Scale / 2, 10);
        zoomLv.ZoomLevel07.Scale = Math.Round(zoomLv.ZoomLevel06.Scale / 2, 10);
        zoomLv.ZoomLevel08.Scale = Math.Round(zoomLv.ZoomLevel07.Scale / 2, 10);
        zoomLv.ZoomLevel09.Scale = Math.Round(zoomLv.ZoomLevel08.Scale / 2, 10);
        zoomLv.ZoomLevel10.Scale = Math.Round(zoomLv.ZoomLevel09.Scale / 2, 10);
        zoomLv.ZoomLevel11.Scale = Math.Round(zoomLv.ZoomLevel10.Scale / 2, 10);
        zoomLv.ZoomLevel12.Scale = Math.Round(zoomLv.ZoomLevel11.Scale / 2, 10);
        zoomLv.ZoomLevel13.Scale = Math.Round(zoomLv.ZoomLevel12.Scale / 2, 10);
        zoomLv.ZoomLevel14.Scale = Math.Round(zoomLv.ZoomLevel13.Scale / 2, 10);
        zoomLv.ZoomLevel15.Scale = Math.Round(zoomLv.ZoomLevel14.Scale / 2, 10);
        zoomLv.ZoomLevel16.Scale = Math.Round(zoomLv.ZoomLevel15.Scale / 2, 10);
        zoomLv.ZoomLevel17.Scale = Math.Round(zoomLv.ZoomLevel16.Scale / 2, 10);
        zoomLv.ZoomLevel18.Scale = Math.Round(zoomLv.ZoomLevel17.Scale / 2, 10);
        zoomLv.ZoomLevel19.Scale = Math.Round(zoomLv.ZoomLevel18.Scale / 2, 10);
        zoomLv.ZoomLevel20.Scale = Math.Round(zoomLv.ZoomLevel19.Scale / 2, 10);
    }

Thanks.

Regards.

Steph.

Hi Steph,

Thanks for your code.

It looks the default scale for zoomlevel 20 of Google is 1128.49722.

And your custom level 13 scale equal 1126.4644432068.

Which means only the level 1 to 13 in your custom zoomlevelset is valid.

If your custom level is bigger than 13, the Google don’t have suitable image, it only return a small image for scale 1128.49722, and that’s why you see the tiles looks separated.

If you choose Google as base map, I think you should want to limit the scale bigger than 1128.49722.

And you mentioned the 10.2.4 works, but when I tested it also don’t works.

I think maybe that’s because other packages version, could you please upload the packages information (You can find it in the package.config file), so I can test it.

Regards,

Ethan

Hi Ethan,

Sorry, I was wrong, it is version 10.2.5 that we use (PackageReference)

PackageReference Include=“MapSuiteDesktopForWpf-Standard”
Version 10.2.5

Regards.
Steph.

Hi Steph,

Here is a sample based on wpf 10.2.5, it looks the map even cannot be shown in high level. I think that’s maybe related with our modify for Google related functions after we receive the email from Google.

9474.zip (10.5 KB)

And I found if you upgrade your GoogleMaps layer package to our latest development version, it works there. I am not sure whether it works just like you viewed before. If so you can upgrade your package to this version.

Regards,

Ethan

Hi Ethan,

We updated with 10.4.5 and it works. thank you.

I have 2 more questions :

  1. just saw that the package has gone into 10.5.2, what are the improvements in this new version ?

  2. Another question, is it possible to remove the black bar that appears on each tile? (ie attached file)

Thanks.

Regards.

Steph.

Hi Steph,

  1. Please view our wiki to get the update information here: https://wiki.thinkgeo.com/wiki/map_suite_desktop_for_wpf_features_bug_fixes_change_log

  2. Remove the bar is not allowed by Google, in fact we only support single tile mode for Google map now, so the map should render one tile and it have one bar there.

Regards,

Ethan

Hi Ethan,

Thanks .
Regards.

Steph.

Hi Steph,

Any question please let us know.

Regards,

Ethan