summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_map.eo
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_map.eo')
-rw-r--r--src/lib/elementary/elm_map.eo532
1 files changed, 0 insertions, 532 deletions
diff --git a/src/lib/elementary/elm_map.eo b/src/lib/elementary/elm_map.eo
deleted file mode 100644
index d821f12..0000000
--- a/src/lib/elementary/elm_map.eo
+++ /dev/null
@@ -1,532 +0,0 @@
1/* FIXME: Handle properly. */
2type Elm_Map_Route: __undefined_type; [[Elementary map route type]]
3type Elm_Map_Route_Cb: __undefined_type; [[Elementary map route callback type]]
4type Elm_Map_Overlay: __undefined_type; [[Elementary map overlay type]]
5type Elm_Map_Name: __undefined_type; [[Elementary map name type]]
6type Elm_Map_Name_Cb: __undefined_type; [[Elementary map name callback type]]
7type Elm_Map_Name_List_Cb: __undefined_type; [[Elementary map name list callback type]]
8type Evas.Event_Mouse_Down: __undefined_type;
9
10enum Elm.Map.Source_Type
11{
12 [[
13 Set type of a external source (provider).
14
15 See @Elm.Map.sources_get()
16 See @Elm.Map.source_get()
17 See @Elm.Map.source_set()
18 ]]
19 tile, [[Map tile provider.]]
20 route, [[Route service provider.]]
21 name, [[Name service provider.]]
22 last [[Sentinel value to indicate last enum field during iteration]]
23}
24
25enum Elm.Map.Route_Type
26{
27 [[
28 Set type of transport used on route.
29
30 See @Elm.Map.route_add()
31 ]]
32 motocar, [[Route should consider an automobile will be used.]]
33 bicycle, [[Route should consider a bicycle will be used by the user.]]
34 foot, [[Route should consider user will be walking.]]
35 last [[Sentinel value to indicate last enum field during iteration]]
36}
37
38
39enum Elm.Map.Route_Method
40{
41 [[
42 Set the routing method, what should be prioritized, time or distance.
43
44 See @Elm.Map.route_add()
45 ]]
46 fastest, [[Route should prioritize time.]]
47 shortest, [[Route should prioritize distance.]]
48 last [[Sentinel value to indicate last enum field during iteration]]
49}
50
51
52class Elm.Map extends Efl.Ui.Widget implements Elm.Interface_Scrollable,
53 Efl.Access.Widget.Action,
54 Efl.Ui.Clickable, Efl.Ui.Legacy, Efl.Ui.Zoom
55{
56 [[Elementary map class]]
57 legacy_prefix: elm_map;
58 eo_prefix: elm_obj_map;
59 event_prefix: elm_map;
60 methods {
61 @property zoom_min {
62 set {
63 [[Set the minimum zoom of the source.]]
64 }
65 get {
66 [[Get the minimum zoom of the source.]]
67 }
68 values {
69 zoom: int(-1); [[Minimum zoom value to be used.]]
70 }
71 }
72 @property map_rotate {
73 set {
74 [[Rotate the map.]]
75 legacy: elm_map_rotate_set;
76 }
77 get {
78 [[Get the rotate degree of the map.]]
79 legacy: elm_map_rotate_get;
80 }
81 values {
82 degree: double; [[Angle from 0.0 to 360.0 to rotate around Z axis.]]
83 cx: int; [[Rotation's center horizontal position.]]
84 cy: int; [[Rotation's center vertical position.]]
85 }
86 }
87 @property user_agent {
88 set {
89 [[Set the user agent used by the map object to access routing
90 services.
91
92 User agent is a client application implementing a network
93 protocol used in communications within a clientserver
94 distributed computing system
95
96 The $user_agent identification string will transmitted in
97 a header field $User-Agent.
98 ]]
99 }
100 get {
101 [[Get the user agent used by the map object.]]
102 }
103 values {
104 user_agent: string; [[The user agent to be used by the map.]]
105 }
106 }
107 @property zoom_max {
108 set {
109 [[Set the maximum zoom of the source.]]
110 }
111 get {
112 [[Get the maximum zoom of the source.]]
113 }
114 values {
115 zoom: int(-1); [[Maximum zoom value to be used.]]
116 }
117 }
118 @property region {
119 get {
120 [[Get the current geographic coordinates of the map.
121
122 This gets the current center coordinates of the map object.
123 It can be set by @.map_region_bring_in and @.region_show.
124 ]]
125 }
126 values {
127 lon: double; [[Pointer to store longitude.]]
128 lat: double; [[Pointer to store latitude.]]
129 }
130 }
131 @property overlays {
132 get {
133 [[Return all overlays in the map object.
134
135 This list includes group overlays also.
136 So this can be changed dynamically while zooming and panning.
137
138 @since 1.7
139 ]]
140 return: list<ptr(Elm_Map_Overlay)>; [[The list of all overlays or $null upon failure.]]
141 }
142 }
143 @property tile_load_status {
144 get {
145 [[Get the information of tile load status.
146
147 This gets the current tile loaded status for the map object.
148 ]]
149 }
150 values {
151 try_num: int; [[Pointer to store number of tiles download requested.]]
152 finish_num: int; [[Pointer to store number of tiles successfully downloaded.]]
153 }
154 }
155 source_set {
156 [[Set the current source of the map for a specific type.
157
158 Map widget retrieves tile images that composes the map from a
159 web service. This web service can be set with this method
160 for #ELM_MAP_SOURCE_TYPE_TILE type. A different service can
161 return a different maps with different information and it can
162 use different zoom values.
163
164 Map widget provides route data based on a external web service.
165 This web service can be set with this method
166 for #ELM_MAP_SOURCE_TYPE_ROUTE type.
167
168 Map widget also provide geoname data based on a external web
169 service. This web service can be set with this method
170 for #ELM_MAP_SOURCE_TYPE_NAME type.
171
172 The $source_name need to match one of the names provided by
173 @.sources_get.
174
175 The current source can be get using @.source_get.
176 ]]
177 params {
178 @in type: Elm.Map.Source_Type; [[Source type.]]
179 @in source_name: string; [[The source to be used.]]
180 }
181 }
182 source_get @const {
183 [[Get the name of currently used source for a specific type.]]
184 return: string; [[The name of the source in use.]]
185 params {
186 @in type: Elm.Map.Source_Type; [[Source type.]]
187 }
188 }
189 route_add {
190 [[Add a new route to the map object.
191
192 A route will be traced by point on coordinates ($flat, $flon)
193 to point on coordinates ($tlat, $tlon), using the route service
194 set with @.source_set.
195
196 It will take $type on consideration to define the route,
197 depending if the user will be walking or driving, the route may
198 vary. One of #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE,
199 or #ELM_MAP_ROUTE_TYPE_FOOT need to be used.
200
201 Another parameter is what the route should prioritize, the minor
202 distance or the less time to be spend on the route. So $method
203 should be one of #ELM_MAP_ROUTE_METHOD_SHORTEST or
204 #ELM_MAP_ROUTE_METHOD_FASTEST.
205
206 Routes created with this method can be deleted with
207 \@ref elm_map_route_del and distance can be get with
208 \@ref elm_map_route_distance_get.
209 ]]
210 return: ptr(Elm_Map_Route); [[The created route or $null upon failure.]]
211 params {
212 @in type: Elm.Map.Route_Type; [[The type of transport to be considered when tracing a route.]]
213 @in method: Elm.Map.Route_Method; [[The routing method, what should be prioritized.]]
214 @in flon: double; [[The start longitude.]]
215 @in flat: double; [[The start latitude.]]
216 @in tlon: double; [[The destination longitude.]]
217 @in tlat: double; [[The destination latitude.]]
218 @in route_cb: Elm_Map_Route_Cb @optional; [[The route to be traced.]]
219 @in data: void_ptr @optional; [[A pointer of user data.]]
220 }
221 }
222 track_add {
223 [[Add a track on the map.]]
224 return: Efl.Canvas.Object; [[The route object. This is an elm object of type Route.]]
225 params {
226 @in emap: void_ptr; [[The emap route object.]]
227 }
228 }
229 region_to_canvas_convert @const {
230 [[Convert geographic coordinates (longitude, latitude)
231 into canvas coordinates.
232
233 This gets canvas x, y coordinates from longitude and latitude.
234 The canvas coordinates mean x, y coordinate from current viewport.
235 ]]
236 params {
237 @in lon: double; [[The longitude to convert.]]
238 @in lat: double; [[The latitude to convert.]]
239 @out x: int; [[A pointer to horizontal coordinate.]]
240 @out y: int; [[A pointer to vertical coordinate.]]
241 }
242 }
243 overlay_circle_add {
244 [[Add a new circle overlay to the map object.
245 This overlay has a circle type.
246
247 Overlay created with this method can be deleted with
248 \@ref elm_map_overlay_del.
249 ]]
250
251 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
252 params {
253 @in lon: double; [[The center longitude.]]
254 @in lat: double; [[The center latitude.]]
255 @in radius: double; [[The pixel length of radius.]]
256 }
257 }
258 overlay_class_add {
259 [[Add a new class overlay to the map object.
260 This overlay has a class type.
261
262 This overlay is not shown before overlay members are appended.
263 if overlay members in the same class are close, group overlays
264 are created. If they are far away, group overlays are hidden.
265 When group overlays are shown, they have default style layouts
266 at first.
267
268 You can change the state (hidden, paused, etc.) or set the
269 content or icon of the group overlays by chaning the state of
270 the class overlay. Do not modify the group overlay itself.
271
272 Also these changes have a influence on the overlays in the
273 same class even if each overlay is alone and is not grouped.
274 ]]
275 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
276 }
277 overlay_bubble_add {
278 [[Add a new bubble overlay to the map object.
279 This overlay has a bubble type.
280
281 A bubble will not be displayed before geographic coordinates
282 are set or any other overlays are followed.
283
284 This overlay has a bubble style layout and icon or content can
285 not be set.
286
287 Overlay created with this method can be deleted with
288 \@ref elm_map_overlay_del.
289 ]]
290 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
291 }
292 sources_get @const {
293 [[Get the names of available sources for a specific type.
294
295 It will provide a list with all available sources.
296 Current source can be set by @.source_set, or get with
297 @.source_get.
298
299 At least available sources of tile type are "Mapnik", "Osmarender",
300 "CycleMap" and "Maplint".
301
302 At least available sources of route type are "Yours".
303
304 At least available sources of name type are "Nominatim".
305 ]]
306 return: legacy(ptr(string)); [[The char pointer array of source names.]]
307 params {
308 @in type: Elm.Map.Source_Type; [[Source type.]]
309 }
310 }
311 overlay_polygon_add {
312 [[Add a new polygon overlay to the map object.
313 This overlay has a polygon type.
314
315 At least 3 regions should be added to show the polygon overlay.
316
317 Overlay created with this method can be deleted with
318 \@ref elm_map_overlay_del.
319 ]]
320 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
321 }
322 overlay_line_add {
323 [[Add a new line overlay to the map object.
324 This overlay has a line type.
325
326 Overlay created with this method can be deleted with
327 \@ref elm_map_overlay_del.
328 ]]
329 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
330 params {
331 @in flon: double; [[The start longitude.]]
332 @in flat: double; [[The start latitude.]]
333 @in tlon: double; [[The destination longitude.]]
334 @in tlat: double; [[The destination latitude.]]
335 }
336 }
337 region_show {
338 [[Show the given coordinates at the center of the map, immediately.
339
340 This causes map to redraw its viewport's contents to the region
341 containing the given $lat and $lon, that will be moved to the
342 center of the map.
343
344 See @.map_region_bring_in for a function to move with animation.
345 ]]
346 params {
347 @in lon: double; [[Longitude to center at.]]
348 @in lat: double; [[Latitude to center at.]]
349 }
350 }
351 name_add @const {
352 [[Request a address or geographic coordinates(longitude, latitude)
353 from a given address or geographic coordinate(longitude, latitude).
354
355 If you want to get address from geographic coordinates, set input
356 $address as $null and set $lon, $lat as you want to convert. If
357 address is set except NULL, $lon and $lat are checked.
358
359 To get the string for this address, \@ref elm_map_name_address_get
360 should be used after callback or "name,loaded" signal is called.
361
362 To get the longitude and latitude, \@ref elm_map_region_get
363 should be used.
364 ]]
365 return: ptr(Elm_Map_Name); [[A #Elm_Map_Name handle for this coordinate.]]
366 params {
367 @in address: string @optional; [[The address.]]
368 @in lon: double; [[The longitude.]]
369 @in lat: double; [[The latitude.]]
370 @in name_cb: Elm_Map_Name_Cb @optional; [[The callback function.]]
371 @in data: void_ptr @optional; [[The user callback data.]]
372 }
373 }
374 name_search @const {
375 [[Requests a list of addresses corresponding to a given name.
376
377 \@internal
378
379 @since 1.8
380 ]]
381 params {
382 @in address: string; [[The address.]]
383 @in name_cb: Elm_Map_Name_List_Cb @optional; [[The callback function.]]
384 @in data: void_ptr @optional; [[The user callback data.]]
385 }
386 }
387 map_region_bring_in {
388 [[Animatedly bring in given coordinates to the center of the map.
389
390 This causes map to jump to the given $lat and $lon coordinates
391 and show it (by scrolling) in the center of the viewport, if it
392 is not already centered. This will use animation to do so and
393 take a period of time to complete.
394
395 See @.region_show for a function to avoid animation.
396 ]]
397 legacy: elm_map_region_bring_in;
398 params {
399 @in lon: double; [[Longitude to center at.]]
400 @in lat: double; [[Latitude to center at.]]
401 }
402 }
403 region_zoom_bring_in {
404 [[Animatedly set the zoom level of the map and bring in given
405 coordinates to the center of the map.
406
407 This causes map to zoom into specific zoom level and also move
408 to the given $lat and $lon coordinates and show it (by scrolling)
409 in the center of the viewport concurrently.
410
411 See also @.map_region_bring_in.
412
413 @since 1.11
414 ]]
415 params {
416 @in zoom: int; [[The zoom level to set.]]
417 @in lon: double; [[Longitude to center at.]]
418 @in lat: double; [[Latitude to center at.]]
419 }
420 }
421 track_remove {
422 [[Remove a track from the map.]]
423 params {
424 @in route: Efl.Canvas.Object; [[The track to remove.]]
425 }
426 }
427 overlay_route_add {
428 [[Add a new route overlay to the map object.
429 This overlay has a route type.
430
431 This overlay has a route style layout and icon or content can
432 not be set.
433
434 The color scheme can be changed by
435 \@ref elm_map_overlay_content_set.
436
437 Overlay created with this method can be deleted with
438 \@ref elm_map_overlay_del.
439 ]]
440 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
441 params {
442 @cref route: Elm_Map_Route; [[The route object to make a overlay.]]
443 }
444 }
445 overlay_scale_add {
446 [[Add a new scale overlay to the map object. This overlay has a
447 scale type.
448
449 The scale overlay shows the ratio of a distance on the map to
450 the corresponding distance.
451
452 Overlay created with this method can be deleted with
453 \@ref elm_map_overlay_del.
454 ]]
455 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
456 params {
457 @in x: int; [[horizontal pixel coordinate.]]
458 @in y: int; [[vertical pixel coordinate.]]
459 }
460 }
461 overlay_add {
462 [[Add a new overlay to the map object. This overlay has a default
463 type.
464
465 A overlay will be created and shown in a specific point of the
466 map, defined by $lon and $lat.
467
468 The created overlay has a default style layout before content or
469 icon is set. If content or icon is set, those are displayed
470 instead of default style layout.
471
472 You can set by using \@ref elm_map_overlay_content_set or
473 \@ref elm_map_overlay_icon_set. If $null is set, default style
474 is shown again.
475
476 Overlay created with this method can be deleted by
477 \@ref elm_map_overlay_del.
478 ]]
479 return: ptr(Elm_Map_Overlay); [[The created overlay or $null upon failure.]]
480 params {
481 @in lon: double; [[The longitude of the overlay.]]
482 @in lat: double; [[The latitude of the overlay.]]
483 }
484 }
485 canvas_to_region_convert @const {
486 [[Convert canvas coordinates into geographic coordinates
487 (longitude, latitude).
488
489 This gets longitude and latitude from canvas x, y coordinates.
490 The canvas coordinates mean x, y coordinate from current viewport.
491 ]]
492 params {
493 @in x: int; [[Horizontal coordinate of the point to convert.]]
494 @in y: int; [[Vertical coordinate of the point to convert.]]
495 @out lon: double; [[A pointer to the longitude.]]
496 @out lat: double; [[A pointer to the latitude.]]
497 }
498 }
499 }
500 implements {
501 class.constructor;
502 Efl.Object.constructor;
503 Efl.Object.invalidate;
504 Efl.Gfx.Entity.position { set; }
505 Efl.Gfx.Entity.size { set; }
506 Efl.Canvas.Group.group_member_add;
507 Efl.Ui.Widget.theme_apply;
508 Efl.Ui.Focus.Object.on_focus_update;
509 Efl.Ui.Widget.widget_event;
510 Efl.Access.Widget.Action.elm_actions { get; }
511 Efl.Ui.Zoom.zoom_level { set; get; }
512 Efl.Ui.Zoom.zoom_mode { set; get; }
513 Efl.Ui.Zoom.zoom_animation { get; set; }
514 Elm.Interface_Scrollable.wheel_disabled { set; }
515 }
516 events {
517 press: Evas.Event_Mouse_Down; [[Called when map was pressed]]
518 loaded: void; [[Called when map loaded]]
519 tile,load: void; [[Called when title load started]]
520 tile,loaded: void; [[Called when title load finished]]
521 tile,loaded,fail: void; [[Called when title load failed]]
522 route,load: Elm_Map_Route; [[Called when route load started]]
523 route,loaded: void; [[Called when route load finished]]
524 route,loaded,fail: void; [[Called when route load failed]]
525 /* FIXME: Can be Elm_Map_Name or list<Elm_Map_Name> */
526 name,load: void; [[Called when name load started]]
527 name,loaded: void; [[Called when name load finished]]
528 name,loaded,fail: void; [[Called when name load failed]]
529 overlay,clicked: Elm_Map_Overlay; [[Called when overlay was clicked]]
530 overlay,del: Elm_Map_Overlay; [[Called when overlay was deleted]]
531 }
532}