GithubHelp home page GithubHelp logo

Comments (6)

nCastle1 avatar nCastle1 commented on July 18, 2024

Hi @GeoITwinkle,

We've been looking into this internally. I don't have an answer to share right now, but I've notified the relevant team and they're investigating. I also shared your Esri Community post with the team. Thank you for including the test project.

I'm hoping to share more in a few days. Thanks for your patience and thanks again for letting us know about the problem.

from arcgis-maps-sdk-dotnet-samples.

GeoITwinkle avatar GeoITwinkle commented on July 18, 2024

Hi @GeoITwinkle,

We've been looking into this internally. I don't have an answer to share right now, but I've notified the relevant team and they're investigating. I also shared your Esri Community post with the team. Thank you for including the test project.

I'm hoping to share more in a few days. Thanks for your patience and thanks again for letting us know about the problem.

Thank you for your follow up. It is not urgent at the moment, but I think it is worth looking into. Thanks!

from arcgis-maps-sdk-dotnet-samples.

nCastle1 avatar nCastle1 commented on July 18, 2024

@GeoITwinkle I confirmed that ArcGIS Runtime currently does not support rotated labels for polygon features. I'll make a note internally to update the sample to make that clearer.

For point features, angles are supported but they need to be specified differently. The following shows an example label definition for point features:

        private const string LabelJson =
@"{
    ""labelExpressionInfo"":{""expression"":""'Label'""},
    ""labelAngleInfo"":
        {
            ""angleExpressionInfo"": {""expression"":""75"",""returnType"":""number""},
            ""rotationType"":""arithmetic""
        },
    ""textLayout"":""straight"",
    ""labelPlacement"":""esriServerPointLabelPlacementAboveRight"",
    ""symbol"":
        { 
            ""borderLineSize"":0,
            ""color"":[255,0,0,255],
            ""font"":
                {
                    ""decoration"":""none"",
                    ""size"":10,
                    ""style"":""normal"",
                    ""weight"":""normal""
                },
            ""horizontalAlignment"":""center"",
            ""type"":""esriTS"",
            ""verticalAlignment"":""middle"",
            ""xoffset"":0,
            ""yoffset"":0
        }
}";

Note that the textLayout field is required for label rotation to work in this case, and that labelPlacement must match the geometry type for the layer. labelingInfo documentation has a list of acceptable values.

from arcgis-maps-sdk-dotnet-samples.

GeoITwinkle avatar GeoITwinkle commented on July 18, 2024

@nCastle1 Thanks Nathan. I will modify the code and see how it goes.

By the way, there is no "LabelAngleInfo" or "textLayout" mentioned in the "labelingInfo documentation" webpage. Probably some kind of update is needed there. Otherwise developers will look into the Angle property of Text Symbol.

from arcgis-maps-sdk-dotnet-samples.

nCastle1 avatar nCastle1 commented on July 18, 2024

@GeoITwinkle Thanks, I'll let the team know about the lack of documentation for those properties.

Angle rotation appears to work for polylines when using the point labelPlacement options:

private const string LabelJson =
@"{
    ""labelExpressionInfo"":{""expression"":""'Label'""},
    ""labelAngleInfo"":
        {
            ""angleExpressionInfo"": {""expression"":""10"",""returnType"":""number""},
            ""rotationType"":""arithmetic""
        },
    ""textLayout"":""straight"",
    ""labelPlacement"":""esriServerPointLabelPlacementAboveRight"",
    ""symbol"":
        { 
            ""borderLineSize"":0,
            ""color"":[255,0,0,255],
            ""font"":
                {
                    ""decoration"":""none"",
                    ""size"":10,
                    ""style"":""normal"",
                    ""weight"":""normal""
                },
            ""horizontalAlignment"":""center"",
            ""type"":""esriTS"",
            ""verticalAlignment"":""middle"",
            ""xoffset"":0,
            ""yoffset"":0
        }
}";

When using the line labelPlacement options (e.g. esriServerLinePlacementBelowEnd), the label is aligned with the polyline regardless of the specified angle.

Let me know if you have any other questions and I'll do my best to get them answered.

One more thing: I can't share full details yet, but there are changes to the API for labeling in Runtime planned for a future release. I recommend keeping an eye on the blog for some exciting announcements.

from arcgis-maps-sdk-dotnet-samples.

GeoITwinkle avatar GeoITwinkle commented on July 18, 2024

@nCastle1 Hi Nathan, I tried point and polyline features and they both work. Although the rotation is somehow interesting, it does not matter now. For future changes, I hope it can provide accessible classes/properties to configure instead of json, will keep an eye on the blog. Thanks again for your help!

from arcgis-maps-sdk-dotnet-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.