headless-studio / leptos-leaflet Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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.
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
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());
})
};
Both, center
and zoom
aren't declared as Signal:
leptos-leaflet/leptos-leaflet/src/components/map_container.rs
Lines 18 to 21 in d65f9a1
Does this mean, I have to re-render the MapContainer
component on every change of the center
or zoom
property?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.