[mapguide-internals] Patch for ticket 1981: Selection highlight size always based on the first layer style

Walt Welton-Lair walt.welton-lair at autodesk.com
Tue Dec 18 08:46:14 PST 2012


Hi Jackie,

Thanks for looking into that defect.

The code which modifies the first scale range to support all scales was added as part of RFC 15 (https://trac.osgeo.org/mapguide/wiki/MapGuideRfc15).  See the following changelist:

http://trac.osgeo.org/mapguide/changeset/1150

At the time that affected code was in StylizationUtil.cpp.

It seems like this patch might impact the behavior described in RFC 15.  In particular the RFC has this paragraph near the end:

> AJAX Viewer behavior will change slightly with this RFC. If the user selects one or more features on a layer,
> and then zooms out to a scale where that layer is not visible, the selected features will still be visible (even
> though other features on that layer are not). This is desirable because you can zoom out and then generate
> a large scale buffer around the selected feature(s) and immediately see the result.

Can you think of any impact this patch might have on the RFC?


I think there's also a bug in the patch.  In the original code, for the case of selection, scale range 0 was first modified to support all scales, and then FindScaleRange was called.  This guarantees FindScaleRange will always return a scale range during selection - if anything, scale range 0 will be returned.  With the new code FindScaleRange is called first.  It might not find a scale range, in which case the code that modifies scale range 0 is called.  But the scaleRange local variable is not updated in that case:

    MdfModel::VectorScaleRange* scaleRange = NULL;
    ...
    scaleRange = Stylizer::FindScaleRange(*scaleRanges, scale);

    // We have a selection but no applicable scale range
    ...
    if (selection && !scaleRange)
    {
        MdfModel::VectorScaleRange* scaleRange = scaleRanges->GetAt(0);
        ...
    }

    if (scaleRange)
    {
        ....
    }


In the case of selection, if FindScaleRange returns NULL at the top, then scaleRange is still NULL at the bottom.  The fix is

    if (selection && !scaleRange)
    {
        scaleRange = scaleRanges->GetAt(0);
        ...
    }


-----Original Message-----
From: mapguide-internals-bounces at lists.osgeo.org [mailto:mapguide-internals-bounces at lists.osgeo.org] On Behalf Of Jackie Ng
Sent: Tuesday, December 18, 2012 6:58 AM
To: mapguide-internals at lists.osgeo.org
Subject: [mapguide-internals] Patch for ticket 1981: Selection highlight size always based on the first layer style

Hi All,

Attached is a patch for ticket 1981.

http://trac.osgeo.org/mapguide/ticket/1981

Please review. Thanks.

- Jackie



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Patch-for-ticket-1981-Selection-highlight-size-always-based-on-the-first-layer-style-tp5023738.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
mapguide-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-internals


More information about the mapguide-internals mailing list