ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo V12 - mapView.ZoomLevelSet is Null

ThinkGeo Team,

Continuing to struggle with ThinkGeo Core. Discovering many little details are different than MapSuite.

Why is it that mapView.ZoomLevelSet is set to null in the Loaded Event? This was not the case in MapSuite and it presents issues for me and I’m sure for other developers as well.

While in VS DebugMode a breakpoint is set in the Loaded Event and the value is null.

image

If the mapView control is expanded then after the expansion ZoomLevelSet is now instantiated.

This is odd behavior and causes issues for me because my code accesses ZoomLevelSet in the Loaded Event prior to layers being loaded.

ZoomLevelSet appears to be set once mapView.CurrentExtent is set.

Would you change this so it behaves the same as MapSuite please?

Thanks,
Dennis

Hi Dennis,

Thanks to let us know your question.

In version 12 we redesign some behaviors, change some default values for example ZoomLevelSet, it works like this now:

  1. ZoomLevelSet don’t set a default value
  2. ZoomLevelSet is calculated when current extent is set
  3. If you manual set ZoomLevelSet, it won’t change after you set the current extent

In previous version the default ZoomLevelSet is always set to decimal degree by default, we found it’s not friendly for most scenarios, and it caused many mismatch problems from user feedback.

If you want to make your code works like before without big changes, you can change in the MapViewLoaded event like this:
mapView.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet(256);

And could you please let us know more detail scenario here? I want to know why the ZoomLevelSet is needed when layer is loaded, so our developer can discuss the requirement, and it should be helpful to let us make map default behavior better.

Regards,

Ethan