| 1 | |
| 2 | = !MapGuide RFC 133 - Additional Stylization Expression Functions = |
| 3 | |
| 4 | This page contains a change request (RFC) for the !MapGuide Open Source project. |
| 5 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 6 | |
| 7 | |
| 8 | == Status == |
| 9 | |
| 10 | ||RFC Template Version||(1.0)|| |
| 11 | ||Submission Date||18 Apr 2013|| |
| 12 | ||Last Modified||18 Apr 2013|| |
| 13 | ||Author||Jackie Ng|| |
| 14 | ||RFC Status||draft|| |
| 15 | ||Implementation Status||ready|| |
| 16 | ||Proposed Milestone||2.6|| |
| 17 | ||Assigned PSC guide(s)||(when determined)|| |
| 18 | ||'''Voting History'''||(vote date)|| |
| 19 | ||+1|||| |
| 20 | ||+0|||| |
| 21 | ||-0|||| |
| 22 | ||-1|||| |
| 23 | ||no vote|| || |
| 24 | |
| 25 | == Overview == |
| 26 | |
| 27 | This RFC proposes to add support for additional expression engine functions to allow for greater stylization flexibility |
| 28 | |
| 29 | == Motivation == |
| 30 | |
| 31 | There are several scenarios that the current stylization expression function suite fails to address, mostly centered around tooltips: |
| 32 | |
| 33 | * Ability to stylize based on current map scale (eg. Scale-dependent tooltips) |
| 34 | * Ability to stylize based on view location (eg. View-specific tooltips) |
| 35 | * Ability to construct useful tooltips for debugging/informative purposes due to key information that about the stylized feature that is missing |
| 36 | |
| 37 | This RFC expands the suite of FDO stylization functions to fulfil these scenarios |
| 38 | |
| 39 | == Proposed Solution == |
| 40 | |
| 41 | Implement the following FDO expression engine functions in the Stylization library: |
| 42 | |
| 43 | * HTMLCOLOR(r, g, b)+ |
| 44 | * FEATURESOURCE() |
| 45 | * LAYERDEFINITION() |
| 46 | * MAPSCALE() |
| 47 | * MAPCENTERX() |
| 48 | * MAPCENTERY() |
| 49 | |
| 50 | + Denotes a MapGuide-specific stylization function |
| 51 | |
| 52 | Each function is described in detail below |
| 53 | |
| 54 | === HTMLCOLOR(r, g, b) === |
| 55 | |
| 56 | Returns the HTML color string based on the integer red, green and blue values provided. This function is more useful for tooltip construction where the existing ARGB() function is inadequate. |
| 57 | |
| 58 | === FEATURESOURCE() === |
| 59 | |
| 60 | Returns the resource ID of the Feature Source where this stylized feature originates from |
| 61 | |
| 62 | Implementation details: |
| 63 | |
| 64 | Store the Feature Source id into the RS_FeatureClassInfo class that is created and set before rendering begins and is also referred to by other stylization |
| 65 | |
| 66 | functions. Evaluating this function returns this set value. |
| 67 | |
| 68 | === LAYERDEFINITION() === |
| 69 | |
| 70 | Returns the resource ID of the Layer Definition that is being used to stylize this feature |
| 71 | |
| 72 | Implementation details: |
| 73 | |
| 74 | Store the Layer Definition id into the RS_LayerUIInfo class that is created and set before rendering begins and is also referred to by other stylization |
| 75 | |
| 76 | functions. Evaluating this function returns this set value. |
| 77 | |
| 78 | === MAPSCALE() === |
| 79 | |
| 80 | Returns the current scale of the map being rendered. |
| 81 | |
| 82 | Implementation details: |
| 83 | |
| 84 | We store the map scale into the RS_MapUIInfo class that is created and set before rendering begins and is also referred to by other stylization functions. |
| 85 | |
| 86 | Evaluating this function returns this set value. |
| 87 | |
| 88 | === MAPCENTERX() === |
| 89 | |
| 90 | Returns the X coordinate of the map's current view center |
| 91 | |
| 92 | Implementation details: |
| 93 | |
| 94 | We store the X coordinate into the RS_MapUIInfo class that is created and set before rendering begins and is also referred to by other stylization functions. |
| 95 | |
| 96 | Evaluating this function returns this set value. |
| 97 | |
| 98 | === MAPCENTERY() === |
| 99 | |
| 100 | Returns the Y coordinate of the map's current view center |
| 101 | |
| 102 | Implementation details: |
| 103 | |
| 104 | We store the Y coordinate into the RS_MapUIInfo class that is created and set before rendering begins and is also referred to by other stylization functions. |
| 105 | |
| 106 | Evaluating this function returns this set value. |
| 107 | |
| 108 | == Implications == |
| 109 | |
| 110 | Layer definitions that use expressions containing theming functions will be stylized correctly only on MapGuide servers from a release that implements those functions. |
| 111 | |
| 112 | == Test Plan == |
| 113 | |
| 114 | Render some labels exercising all of the above functions for a layer in a map at various positions and zoom levels. The labels rendered out should contain the expected values returned by these functions. |
| 115 | |
| 116 | == Funding / Resources == |
| 117 | |
| 118 | Community |