Frank,
I tested your code and got irregular results - sometime it worked, other
times it did not. It ignored the IF.. statement randomly, I think this may
be the result of zoomGoToLocation putting map into a busy state -
setAutoRefresh is ignored by it so that won't work. It looks like this
function is to obviously zoom to the object, but then add it to the
selection set so the user can see it as selected. If that's the case, add
the object to the selection before calling zoomGoToLocation - this always
works.
function zoomParcel(pin)
{
var map = getMap();
if (!map.isBusy())
{
var sel = map.getSelection();
sel.clear();//this is optional - use only if you want the current pin in
the selection
var layer = map.getMapLayer("Parcels");
var obj = layer.getMapObject(pin);
sel.addObject(obj, true);
map.zoomGoToLocation("Parcel Search", pin, 10000);
}
Scott
"Frank Oquendo" wrote in message
news:DB118E81DAEDF5C67F3B249A20CACFB2@in.WebX.maYIadrTaRb...
> Scott Friedrich had this to say:
>
> > I have duplicated your problem - try these two approaches - they work.
>
> Scott,
>
> Thanks for the help. Unfortunately, nothing seems to help. Below is the
code
> I'm using. I finally wrapped the selection code in an if statement just to
> avoid the error. Needless to say, the code inside the if block never
> executes.
>
> function zoomParcel(pin) {
> var map = getMap();
> if (!map.isBusy()) {
> var sel = map.getSelection();
> map.zoomGoToLocation("Parcel Search", pin, 10000);
> if (sel != null) {
> var layer = map.getMapLayer("Parcels");
> var obj = layer.getMapObject(pin);
> sel.addObject(obj, true);
> }
> }
> }
>
> --
> There are 10 kinds of people:
> Those who understand binary and those who don't
> http://www.acadx.com
> http://vbxtender.sourceforge.net
>
>