Skip to content

Commit

Permalink
Merge pull request #15 from emirror-de/leaflet-rs
Browse files Browse the repository at this point in the history
Using leaflet-rs as dependency
  • Loading branch information
dgsantana authored Nov 16, 2023
2 parents aab774a + 1115cdf commit 2c1d70b
Show file tree
Hide file tree
Showing 57 changed files with 218 additions and 3,097 deletions.
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

0 comments on commit 2c1d70b

Please sign in to comment.