Hello all:
I'm working on a user control that wraps some of the functionality of the VE maps. It can be "maximized" and "restored" by clicking on an image (just as the middle button of any window does).Initially the map is positioned in any city and can have several pushpins for different locations in that city. When the button is clicked and it is "maximized" some of the pushpins (actually most of them) dissappear , only 3 or 4 of 20 remain visible, BUT if i drag the map or move it with the arrows of the dashboard they appear again .
Inside the javascript function called by the onclick event for this image , the "core code" originally was as follows:
//(...)Initialization stuff ...determining which is the new state , etc...
//Now the part that really do the change effect
var cent= mapVar.GetCenter();
mapCtrl.className= newStateCSS; //the min-max effect is accomplished by a change of styles, mapCtrl is the container div
mapVar.Resize(); //so the map fills the new size of the container
mapVar.SetCenter(cent);
After that not working as intended, i've tried everything ...
First i was using the default shape layer and i thought "maybe is that" so later i decided to add the pushpins to another layer rather than the default one... Inside the onclick i've tested all of the following, (independently and combined... and c),d),e),f)g) also tested working only with the default layer ):
a)hide and show the layer,
b) create another layer, create pushpins on it with the info of the originals and then delete the original layer and add the new one
c)cycle through the pushpins and Hide/Show them
d)SetCenterAndZoom instead of only SetCenter
e)mapVar.Pan
f)mapVar.SetZoomLevel
g) used the "undocumented mapVar.m_vegraphicsmanager.Update();" some say it seems to solve things like this one in certain cases...
...All that and the result is always the same only 3 or 4 pushpins visible until the map is dragged/moved by the arrow control
Does anyone have another idea of how to "refresh" the map so all the pushpins are always visible?