Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyline Icon with path as SymbolPath fails render #392

Closed
SamVanhoutte opened this issue Dec 13, 2024 · 3 comments
Closed

Polyline Icon with path as SymbolPath fails render #392

SamVanhoutte opened this issue Dec 13, 2024 · 3 comments

Comments

@SamVanhoutte
Copy link

Hello there ,

I have upgraded to the latest version of BlazorGoogleMaps (4.9.1) , but when I want to plot a single Polyline on the map, I get a Javascript error in the console and the polyline is not plotted.

The error is the following:

util.js:354  Uncaught Error: First instruction in path must be "moveto".
    at iJa.parse (util.js:354:2008)
    at THa.parse (util.js:354:609)
    at k1a.Hg (util.js:249:130)
    at poly.js:52:184
    at Array.map (<anonymous>)
    at F_a (poly.js:52:166)
    at poly.js:23:109

All code can be found in my repo https://github.com/samvanhoutte/cotacol-site
And more specifically in the following code files:

It used to work before, so I cannot put my finger on what exactly would have been changed, other than upgrade to net8 and the latest BlazorGoogleMaps.

If you want to see it live at action , this is a sample page: https://cotacol.eu/cotacol/270
And a screenshot for reference of that page:

image
@SamVanhoutte SamVanhoutte changed the title Javascript error and polyline not plotted since a while Javascript error and polyline not plotted after upgrade to net8 / 4.9.1 Dec 13, 2024
@SamVanhoutte
Copy link
Author

A bit more information , as it seems to be related to the usage of Icons on the PolyLineOptions object.

So, when I have the showArrow variable set to false, the polyline is plotted.

But when this part is added, it fails with the exception:

            if (showArrow)
            {
                options.Icons = new[]
                {
                    new IconSequence
                    {
                        Icon = new Symbol { Path = SymbolPath.CIRCLE, Scale = 3f, StrokeColor = "green" },
                        Offset = "0%"
                    },
                    new IconSequence
                    {
                        Icon = new Symbol { Path = SymbolPath.CIRCLE, Scale = 3f, StrokeColor = "red" },
                        Offset = "100%"
                    },
                    // new IconSequence
                    // {
                    //     Icon = new Symbol {Path = SymbolPath.FORWARD_OPEN_ARROW, Scale = 3f},
                    //     Offset = "50%"
                    // },
                };
            }

@valentasm1 valentasm1 changed the title Javascript error and polyline not plotted after upgrade to net8 / 4.9.1 Polyline Icon with path as SymbolPath fails render Dec 14, 2024
@valentasm1
Copy link
Collaborator

@SamVanhoutte
Copy link
Author

I can confirm this works - thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants