View Single Post
04/11/14, 07:27 AM   #7
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
Originally Posted by Xrystal View Post
I'm guessing then that the pinManager automatically places the co-ords in the correct zone ?
the callback is called everytime a different zone is displayed. you have to handle the zone by yourself.
though you have done that already:
Lua Code:
  1. local drawCallback = function(pinManager)
  2.     SetMapToPlayerLocation()
  3.     local pinZone = GetMapName()
  4.     local harvestData = self.Data[pinType][pinZone]
  5.     for i,v in pairs(harvestData) do
  6.        pinManager:CreatePin(_G[pinType], v.key, v.zone, v.x, v.y, v.radius)
  7.     end
  8. end
you only draw the pins in the current zone.

edit:
i think you have to remove SetMapToPlayerLocation().
if the player changes the currently displayed map (eg right click) the drawCallback is called and immediatly sets the map back to the player's position.
  Reply With Quote