Coder Social home page Coder Social logo

Comments (5)

jvakos avatar jvakos commented on August 14, 2024

I found this https://stackoverflow.com/a/58530025/1327555 that assumes LatLngLitteral must not be used in heatmap data. LatLng is the way. I tried to fix it but I cannot find the point in code that converts the .net types to js types (or something like this)

from blazorgooglemaps.

valentasm1 avatar valentasm1 commented on August 14, 2024

Could you post more code? I want to reproduce.

from blazorgooglemaps.

jvakos avatar jvakos commented on August 14, 2024

In Maps.razor (server-side project)

map1 = await Map.CreateAsync(JsRuntime, map1ElementRef, mapOptions1);
 var heatMap = await HeatmapLayer.CreateAsync(JsRuntime, new HeatmapLayerOptions {
                Map = map1,
                Dissipating=true,
                Radius=10,                
            });

            var heatPoints = new[] {
                new LatLngLiteral{                        
                            Lat = 15,
                            Lng = 15,                                                
                },
                new LatLngLiteral{                        
                            Lat = 25,
                            Lng = 25,                                                
                },
            };

            await heatMap.SetData(heatPoints);

from blazorgooglemaps.

valentasm1 avatar valentasm1 commented on August 14, 2024

We serialize .net object to string and pass to object constructor. I have no problem with properties. Since LatLng uses method to return value this way will not work. I added commit to work with SetData with custom coordinates and added if in main method to convert to good format. Get solution and check server side sample. I added sample page with heatmap.
Check commit and let me know if you will make pull request with fixed rest parts? I could do it till September since i take some time.

d0409c5

from blazorgooglemaps.

valentasm1 avatar valentasm1 commented on August 14, 2024

Released with newest nuget. Closing.

from blazorgooglemaps.

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.