View Single Post
05/02/21, 08:15 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,011
You need to provide more information please:
1st: Why that function? What do you like to achieve, and when?
2nd: When do you call your code?
3rd: Your code example (complete addon or at least code that runs like an addon to be able to find your bug/problem)

btw: I think MapDisplayControl is not an existing variable ingame but just an "example name of an object/control used in the ESOUIDocumentation_Pxx.txt file, or the Wiki's control section". Did you try to inspect ZO_WorldMap with an addon like merTorchbug Updated or zgoo?
You can check the table shown if it contains the GetZoom function or maybe the __index metatables of it will have them.
Maybe this is the object which holds the functions for the zoom, and which should be used here.

Or try to use this function:
https://github.com/esoui/esoui/blob/...dmap.lua#L4505
ZO_WorldMap_GetPanAndZoom()
It will return the pointer to the local variable g_mapPanAndZoom
And this variable is of the type ZO_MapPanAndZoom
https://github.com/esoui/esoui/blob/...dmap.lua#L3181

So you got access to all the map's zoom functions via this function's return value.
You can find all the functions here:
https://github.com/esoui/esoui/blob/...dmap.lua#L2446
e.g. ZO_MapPanAndZoom:CanMapZoom etc.

Or via using merTorchbug ingame like this (open the map first):
Code:
/tb ZO_WorldMap_GetPanAndZoom()
It will open the torchbug inspecto returning you the table with all the data that ZO_MapPanAndZoom currently shows:

But it also provides the attribute like maxZoom, minZoom and currentNormalizedZoom which might be the value you search for.
If you change the zoom slider at the map and then reuse the /tb ZO_WorldMap_GetPanAndZoom() (or press the refresh button o at the headline of the torchbug inspector window) it will update the table and show you the new value of currentNormalizedZoom.
e.g. medium zoom at slider middle will be currentNormalizedZoom = 0.5




Not sure what your usecase it. This object does not seem to provide any GetZoom function. But there exist other ZO_WorldMap_Get* functions which might return objects you want to inspect and check if they provide that info needed.

Last edited by Baertram : 05/02/21 at 09:14 AM.
  Reply With Quote