@@ -123,19 +123,19 @@ impl LTN {
123
123
}
124
124
125
125
#[ wasm_bindgen( js_name = setCurrentNeighbourhood) ]
126
- pub fn set_current_neighbourhood ( & mut self , name : String ) -> Result < String , JsValue > {
126
+ pub fn set_current_neighbourhood ( & mut self , name : String ) -> Result < ( ) , JsValue > {
127
127
let boundary_gj = self . map . boundaries . get ( & name) . cloned ( ) . unwrap ( ) ;
128
128
let mut boundary_geo: Polygon = boundary_gj. try_into ( ) . map_err ( err_to_js) ?;
129
129
self . map . mercator . to_mercator_in_place ( & mut boundary_geo) ;
130
130
131
131
self . neighbourhood =
132
132
Some ( Neighbourhood :: new ( & self . map , name, boundary_geo) . map_err ( err_to_js) ?) ;
133
- self . render_neighbourhood ( )
133
+ Ok ( ( ) )
134
134
}
135
135
136
136
/// Takes a LngLat
137
137
#[ wasm_bindgen( js_name = addModalFilter) ]
138
- pub fn add_modal_filter ( & mut self , input : JsValue , kind : String ) -> Result < String , JsValue > {
138
+ pub fn add_modal_filter ( & mut self , input : JsValue , kind : String ) -> Result < ( ) , JsValue > {
139
139
let pos: LngLat = serde_wasm_bindgen:: from_value ( input) ?;
140
140
self . map . add_modal_filter (
141
141
self . map . mercator . pt_to_mercator ( Coord {
@@ -145,16 +145,12 @@ impl LTN {
145
145
& self . neighbourhood . as_ref ( ) . unwrap ( ) . interior_roads ,
146
146
FilterKind :: from_string ( & kind) . unwrap ( ) ,
147
147
) ;
148
- self . render_neighbourhood ( )
148
+ Ok ( ( ) )
149
149
}
150
150
151
151
/// Takes a LineString feature
152
152
#[ wasm_bindgen( js_name = addManyModalFilters) ]
153
- pub fn add_many_modal_filters (
154
- & mut self ,
155
- input : JsValue ,
156
- kind : String ,
157
- ) -> Result < String , JsValue > {
153
+ pub fn add_many_modal_filters ( & mut self , input : JsValue , kind : String ) -> Result < ( ) , JsValue > {
158
154
let gj: Feature = serde_wasm_bindgen:: from_value ( input) ?;
159
155
let mut linestring: LineString = gj. try_into ( ) . map_err ( err_to_js) ?;
160
156
self . map . mercator . to_mercator_in_place ( & mut linestring) ;
@@ -164,22 +160,19 @@ impl LTN {
164
160
& self . neighbourhood . as_ref ( ) . unwrap ( ) . interior_roads ,
165
161
FilterKind :: from_string ( & kind) . unwrap ( ) ,
166
162
) ;
167
- self . render_neighbourhood ( )
163
+ Ok ( ( ) )
168
164
}
169
165
170
166
#[ wasm_bindgen( js_name = deleteModalFilter) ]
171
- pub fn delete_modal_filter ( & mut self , road : usize ) -> Result < String , JsValue > {
167
+ pub fn delete_modal_filter ( & mut self , road : usize ) {
172
168
self . map . delete_modal_filter ( RoadID ( road) ) ;
173
- self . render_neighbourhood ( )
174
169
}
175
170
176
- pub fn undo ( & mut self ) -> Result < String , JsValue > {
171
+ pub fn undo ( & mut self ) {
177
172
self . map . undo ( ) ;
178
- self . render_neighbourhood ( )
179
173
}
180
- pub fn redo ( & mut self ) -> Result < String , JsValue > {
174
+ pub fn redo ( & mut self ) {
181
175
self . map . redo ( ) ;
182
- self . render_neighbourhood ( )
183
176
}
184
177
185
178
#[ wasm_bindgen( js_name = getShortcutsCrossingRoad) ]
0 commit comments