Map¶

Widget description¶
The Map is a widget specifically for displaying a geographic map. It uses OpenStreetMap as map tile provider, YOURS for routing calculation and Nominatim to convert geographic coordinates to/from address names. But custom providers can be added.
It supports some basic but yet nice features:
zooming and scrolling
markers with content to be displayed when user clicks over them
automatic grouping of markers based on zoom level
routes calculation
names/coordinates conversion (and viceversa)
Emitted signals¶
clicked
- Called when a user has clicked the map without dragging around.clicked,double
- Called when a user has double-clicked the map.press
- This is called when a user has pressed down on the map.longpressed
- This is called when a user has pressed down on the map for a long time without dragging around.scroll
- the content has been scrolled (moved).scroll,drag,start
- dragging the contents around has started.scroll,drag,stop
- dragging the contents around has stopped.scroll,anim,start
- scrolling animation has started.scroll,anim,stop
- scrolling animation has stopped.zoom,start
- Zoom animation started.zoom,stop
- Zoom animation stopped.zoom,change
- Zoom changed when using an auto zoom mode.tile,load
- A map tile image load begins.tile,loaded
- A map tile image load ends.tile,loaded,fail
- A map tile image load fails.route,load
- Route request begins.route,loaded
- Route request ends.route,loaded,fail
- Route request fails.name,load
- Name request begins.name,loaded
- Name request ends.name,loaded,fail
- Name request fails.overlay,clicked
- A overlay is clicked.loaded
- when a map is finally loaded.
Scrollable Interface¶
This widget supports the scrollable interface.
If you wish to control the scolling behaviour using these functions,
inherit both the widget class and the
Scrollable
class
using multiple inheritance, for example:
class ScrollableGenlist(Genlist, Scrollable):
def __init__(self, canvas, *args, **kwargs):
Genlist.__init__(self, canvas)
Enumerations¶
Map overlay types¶
- efl.elementary.ELM_MAP_OVERLAY_TYPE_NONE¶
None
- efl.elementary.ELM_MAP_OVERLAY_TYPE_DEFAULT¶
The default overlay type.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_CLASS¶
The Class overlay is used to group marker together.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_GROUP¶
A group of overlays.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_BUBBLE¶
This class can follow another overlay.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_ROUTE¶
This is used to draw a route result on the map.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_LINE¶
Simply draw a line on the map.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_POLYGON¶
Simply draw a polygon on the map.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_CIRCLE¶
Simply draw a circle on the map.
- efl.elementary.ELM_MAP_OVERLAY_TYPE_SCALE¶
This will draw a dinamic scale on the map.
Map route methods¶
- efl.elementary.ELM_MAP_ROUTE_METHOD_FASTEST¶
Route should prioritize time
- efl.elementary.ELM_MAP_ROUTE_METHOD_SHORTEST¶
Route should prioritize distance
Map route types¶
- efl.elementary.ELM_MAP_ROUTE_TYPE_MOTOCAR¶
Route should consider an automobile will be used.
- efl.elementary.ELM_MAP_ROUTE_TYPE_BICYCLE¶
Route should consider a bicycle will be used by the user.
- efl.elementary.ELM_MAP_ROUTE_TYPE_FOOT¶
Route should consider user will be walking.
Map source types¶
- efl.elementary.ELM_MAP_SOURCE_TYPE_TILE¶
Map tile provider
- efl.elementary.ELM_MAP_SOURCE_TYPE_ROUTE¶
Route service provider
- efl.elementary.ELM_MAP_SOURCE_TYPE_NAME¶
Name service provider
Map zoom modes¶
- efl.elementary.ELM_MAP_ZOOM_MODE_MANUAL¶
Zoom controlled manually by
zoom
It’s set by default.
- efl.elementary.ELM_MAP_ZOOM_MODE_AUTO_FIT¶
Zoom until map fits inside the scroll frame with no pixels outside this area.
- efl.elementary.ELM_MAP_ZOOM_MODE_AUTO_FILL¶
Zoom until map fills scroll, ensuring no pixels are left unfilled.