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?

Recommended Answers

All 2 Replies

are you using any special framework library or you have written every thing by your self ?

No. Nothing special, just the Virtual Earth SDK for all the map-related behavior,and plain ASP.NET (C#) for the definition of the wrapper control and its server side (which consists only in its initialization and generation of the proper javascript functions, as all the work is performed at the client-side).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.