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

Using leaflet-rs as dependency #15

Merged
merged 7 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[workspace]
members = ["leptos-leaflet", "leaflet"]
members = ["leptos-leaflet"]
exclude = ["examples/simple-map", "examples/with-server"]
resolver = "2"

[workspace.dependencies]
getrandom = { version = "0.2", features = ["js"] }
js-sys = "0.3"

leaflet = { path = "./leaflet" }
leaflet = "0.3"
leptos = { version = "0.5", default-features = false }
leptos_meta = { version = "0.5", default-features = false }

Expand Down
5 changes: 4 additions & 1 deletion examples/simple-map/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion examples/with-server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 18 additions & 11 deletions examples/with-server/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Duration;

use leptos::logging::log;
use leptos::*;
use leptos_leaflet::leaflet::{LocationEvent, Map};
Expand Down Expand Up @@ -38,16 +40,16 @@ fn HomePage() -> impl IntoView {
let (map, set_map) = create_signal(None::<Map>);

create_effect(move |_| {
// set_interval_with_handle(
// move || {
// set_marker_position.update(|pos| {
// pos.lat += 0.001;
// pos.lng += 0.001;
// });
// },
// Duration::from_millis(200),
// )
// .ok()
set_interval_with_handle(
move || {
set_marker_position.update(|pos| {
pos.lat += 0.001;
pos.lng += 0.001;
});
},
Duration::from_secs(1),
)
.ok()
});

create_effect(move |_| {
Expand All @@ -57,7 +59,7 @@ fn HomePage() -> impl IntoView {
});

let location_found = move |loc: LocationEvent| {
log!("hello from {:?}", loc.latlng());
log!("hello from {:?}", loc.lat_lng());
};

let events = MapEvents::new().location_found(location_found);
Expand All @@ -75,6 +77,11 @@ fn HomePage() -> impl IntoView {
<strong>{"A pretty CSS3 popup"}</strong>
</Popup>
</Marker>
<Marker position=marker_position draggable=true >
<Popup auto_close=false close_on_click=false>
<strong>{"A moving marker"}</strong>
</Popup>
</Marker>
<Tooltip position=position!(51.5, -0.09) permanent=true direction="top">
<strong>{"And a tooltip"}</strong>
</Tooltip>
Expand Down
15 changes: 0 additions & 15 deletions leaflet/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions leaflet/src/control.rs

This file was deleted.

30 changes: 0 additions & 30 deletions leaflet/src/crs.rs

This file was deleted.

35 changes: 0 additions & 35 deletions leaflet/src/div_icon.rs

This file was deleted.

50 changes: 0 additions & 50 deletions leaflet/src/div_overlay.rs

This file was deleted.

42 changes: 0 additions & 42 deletions leaflet/src/event.rs

This file was deleted.

Loading