Giter VIP home page Giter VIP logo

leptos-leaflet's People

Contributors

dgsantana avatar emirror-de avatar houski avatar lounecode avatar wollaston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

leptos-leaflet's Issues

Note on using "serde-serialize" feature of wasm-bindgen instead of serde-wasm-bindgen

Hi all,

First, thanks for the cool crate. I have been enjoying experimenting with it in a few of my projects.

An issue I came across is that depending on other project dependencies, using the wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } can cause a "cyclic package dependency" and prevent the project from building (the getrandom crate ends up depending on itself). I did some research on this issue in the Rust Wasm context, and this can be caused by using that serde-deserialize feature of wasm-bindgen. Removing that feature and instead using the serde-wasm-bindgen crate in its place resolves this issue. Making this update on a local branch let my project compile and run without issue. I also tested the leptos-leaflet project examples with this change, and they also seem to run just fine.

Here is some discussion on this issue that helped me resolve it:

I make this issue as the update is not strictly required, but it can lead to a bit of confusion as it comes up depending on the other project dependencies without too much help from the standard Cargo error messages.

I can make a pull request correcting the Cargo.toml for the main library if that would be helpful. Otherwise, anyone else who comes across this issue can make the update locally or in a fork and resolve the issue that way. Thank you again.

Adding rustfmt.toml

To get the same code formatting for every developer, would you be interested in adding a rustfmt.toml to this project?

For example:

max_width = 80
format_strings = false
imports_layout = "HorizontalVertical"
imports_granularity="One"
reorder_imports = true

Type Casting Issue: Accessing Marker from DragEndEvent in Rust

I want to update some state each time I encounter a DragEndEvent based on the new position of a marker.
Unfortunately, I can't figure out how to tell the Rust Compiler that I can definitely get at the marker by calling target on the event.
Is there a way to do this?

    let drag_events = {
        DragEvents::new().on_drag_end(move |ev: DragEndEvent| {
            let marker = ev.target() as Marker;
            let pt = marker.get_lat_lng();
            set_lat(pt.lat());
            set_lng(pt.lng());
        })
    };

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.