Evas_Coord cx, cy;
double level;
} pinch_zoom;
+ double wheel_zoom;
+ Ecore_Timer *wheel_timer;
+ Eina_Bool wheel_disabled : 1;
};
struct _Mod_Api
static void _pan_calculate(Evas_Object *obj);
static Eina_Bool _hold_timer_cb(void *data);
+static Eina_Bool _wheel_timer_cb(void *data);
static void _rect_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
-
Eina_List *lr, *lp, *ln;
Route_Node *n;
Evas_Object *p;
Elm_Map_Route *r;
int nodes;
int x, y, rx, ry;
+
+ if (!wd) return;
Evas_Coord size = pow(2.0, wd->zoom)*wd->tsize;
EINA_LIST_FOREACH(wd->route, lr, r)
static void
rect_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord ax, ay, gw, gh, hh, ww;
+
if (!wd) return;
evas_object_geometry_get(wd->rect, NULL, NULL, &ww, &hh);
static void
marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord ax, ay, gw, gh, tx, ty;
Eina_List *l, *markers;
static void
grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord ax, ay, gw, gh, tx, ty;
int xx, yy, ww, hh;
if (!wd) return;
-
ax = 0;
ay = 0;
gw = wd->size.w;
static void
grid_clear(Evas_Object *obj, Grid *g)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
char buf[PATH_MAX];
static void
grid_load(Evas_Object *obj, Grid *g)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
int x, y;
int size;
static void
grid_clearall(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Grid *g;
static void
_smooth_update(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *l;
Grid *g;
static Eina_Bool
_scr_timeout(void *data)
{
+ ELM_CHECK_WIDTYPE(data, widtype) ECORE_CALLBACK_CANCEL;
Widget_Data *wd = elm_widget_data_get(data);
+
if (!wd) return ECORE_CALLBACK_CANCEL;
wd->nosmooth--;
if (!wd->nosmooth) _smooth_update(data);
static void
_scr(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
+ ELM_CHECK_WIDTYPE(data, widtype);
Widget_Data *wd = elm_widget_data_get(data);
+
if (!wd) return;
if (!wd->scr_timer)
{
static void
zoom_do(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord xx, yy, ow, oh;
if (!wd) return;
-
wd->size.w = wd->size.nw;
wd->size.h = wd->size.nh;
elm_smart_scroller_child_viewport_size_get(wd->scr, &ow, &oh);
- elm_map_utils_convert_geo_into_coord(obj, wd->center_on.lon, wd->center_on.lat, wd->size.w, &xx, &yy);
- xx -= ow / 2;
- yy -= oh / 2;
+
+ if (wd->center_on.enabled)
+ {
+ elm_map_utils_convert_geo_into_coord(obj, wd->center_on.lon, wd->center_on.lat, wd->size.w, &xx, &yy);
+ xx -= ow / 2;
+ yy -= oh / 2;
+ }
+ else
+ {
+ xx = (wd->size.spos.x * wd->size.w) - (ow / 2);
+ yy = (wd->size.spos.y * wd->size.h) - (oh / 2);
+ }
+
if (xx < 0) xx = 0;
else if (xx > (wd->size.w - ow)) xx = wd->size.w - ow;
static Eina_Bool
_zoom_anim(void *data)
{
+ ELM_CHECK_WIDTYPE(data, widtype) ECORE_CALLBACK_CANCEL;
Evas_Object *obj = data;
Widget_Data *wd = elm_widget_data_get(obj);
double t;
if ((t >= 2.0) || (t <= 0.5))
{
+ wd->zoom_animator = NULL;
wd->pinch.level = 1.0;
zoom_do(obj);
- wd->zoom_animator = NULL;
evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
return ECORE_CALLBACK_CANCEL;
}
- else
+ else if (t != 1.0)
{
Evas_Coord x, y, w, h;
float half_w, half_h;
-
evas_object_geometry_get(data, &x, &y, &w, &h);
half_w = (float)w * 0.5;
half_h = (float)h * 0.5;
-
- wd->pinch.level = t;
wd->pinch.cx = x + half_w;
wd->pinch.cy = y + half_h;
+ wd->pinch.level = t;
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
- return ECORE_CALLBACK_RENEW;
}
+ return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_long_press(void *data)
{
+ ELM_CHECK_WIDTYPE(data, widtype) ECORE_CALLBACK_CANCEL;
Widget_Data *wd = elm_widget_data_get(data);
+
if (!wd) return ECORE_CALLBACK_CANCEL;
wd->long_timer = NULL;
evas_object_smart_callback_call(data, SIG_LONGPRESSED, &wd->ev);
Evas_Event_Mouse_Down *ev = event_info;
Event *ev0;
+ if (!wd) return;
+ if (ev->button == 2)
+ {
+ if (wd->wheel_timer) ecore_timer_del(wd->wheel_timer);
+ wd->wheel_timer = ecore_timer_add(0.35, _wheel_timer_cb, data);
+ return;
+ }
+
ev0 = get_event_object(data, 0);
if (ev0) return;
ev0 = create_event_object(data, obj, 0);
ev0->prev.x = ev->output.x;
ev0->prev.y = ev->output.y;
- if (!wd) return;
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE;
else wd->on_hold = EINA_FALSE;
{
ELM_CHECK_WIDTYPE(data, widtype);
Widget_Data *wd = elm_widget_data_get(data);
+
+ if (!wd) return;
Evas_Event_Mouse_Up *ev = event_info;
int mdevice;
Event *ev0;
destroy_event_object(data, ev0);
}
- if (!wd) return;
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE;
else wd->on_hold = EINA_FALSE;
Event *ev0;
Event *ev;
Eina_Bool tp;
- double t = 0.0;
+ double t;
wd->multi_count--;
if (wd->calc_job) ecore_job_del(wd->calc_job);
destroy_event_object(data, ev);
}
+static void
+_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+ ELM_CHECK_WIDTYPE(data, widtype);
+ Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Event_Mouse_Wheel *ev = (Evas_Event_Mouse_Wheel*) event_info;
+ Evas_Coord x, y, w, h;
+ float half_w, half_h;
+ evas_object_geometry_get(data, &x, &y, &w, &h);
+ half_w = (float)w * 0.5;
+ half_h = (float)h * 0.5;
+
+ if (!wd->wheel_zoom) wd->wheel_zoom = 1.0;
+ if (ev->z > 0)
+ {
+ wd->zoom_method = ZOOM_METHOD_OUT;
+ wd->wheel_zoom -= 0.1;
+ if (wd->wheel_zoom <= PINCH_ZOOM_MIN) wd->wheel_zoom = PINCH_ZOOM_MIN;
+ }
+ else
+ {
+ wd->zoom_method = ZOOM_METHOD_IN;
+ wd->wheel_zoom += 0.1;
+ if (wd->wheel_zoom >= PINCH_ZOOM_MAX) wd->wheel_zoom = PINCH_ZOOM_MAX;
+ }
+
+ wd->pinch.level = wd->wheel_zoom;
+ wd->pinch.cx = x + half_w;
+ wd->pinch.cy = y + half_h;
+ if (wd->calc_job) ecore_job_del(wd->calc_job);
+ wd->calc_job = ecore_job_add(_calc_job, wd);
+}
+
+
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL;
static Eina_Bool
return ECORE_CALLBACK_CANCEL;
}
+static Eina_Bool
+_wheel_timer_cb(void *data)
+{
+ ELM_CHECK_WIDTYPE(data, widtype) ECORE_CALLBACK_CANCEL;
+ Widget_Data *wd = elm_widget_data_get(data);
+ int zoom;
+
+ wd->wheel_timer = NULL;
+ if (wd->zoom_method == ZOOM_METHOD_IN) zoom = (int)ceil(wd->wheel_zoom - 1.0);
+ else if (wd->zoom_method == ZOOM_METHOD_OUT) zoom = (int)floor((-1.0 / wd->wheel_zoom) + 1.0);
+ else return ECORE_CALLBACK_CANCEL;
+ elm_map_zoom_set(data, wd->zoom + zoom);
+ wd->wheel_zoom = 0.0;
+ return ECORE_CALLBACK_CANCEL;
+}
+
static void
_rect_resize_cb(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
+ ELM_CHECK_WIDTYPE(data, widtype);
Widget_Data *wd = elm_widget_data_get(data);
int x, y, w, h;
static void
_del_hook(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
Elm_Map_Group_Class *group_clas;
Elm_Map_Marker_Class *marker_clas;
- Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *l;
Event *ev;
Evas_Object *p;
Elm_Map_Name *na;
if (!wd) return;
-
EINA_LIST_FREE(wd->groups_clas, group_clas)
{
if (group_clas->style)
static void
_del_pre_hook(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
Marker_Group *group;
Elm_Map_Marker *marker;
int i;
Eina_Bool free_marker = EINA_TRUE;
Eina_List *l;
- Widget_Data *wd = elm_widget_data_get(obj);
- grid_clearall(obj);
if (!wd) return;
+ grid_clearall(obj);
for (i = 0; i < ZOOM_MAX + 1; i++)
{
if (!wd->markers[i]) continue;
static void
_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
if (elm_widget_focus_get(obj))
{
static void
_theme_hook(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
elm_smart_scroller_object_theme_set(obj, wd->scr, "map", "base", elm_widget_style_get(obj));
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
static void
_sizing_eval(Evas_Object *obj)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
+
if (!wd) return;
evas_object_size_hint_max_get(wd->scr, &maxw, &maxh);
evas_object_size_hint_min_set(obj, minw, minh);
static void
_hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
elm_smart_scroller_hold_set(wd->scr, 1);
}
static void
_hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
elm_smart_scroller_hold_set(wd->scr, 0);
}
static void
_freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
elm_smart_scroller_freeze_set(wd->scr, 1);
}
static void
_freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
elm_smart_scroller_freeze_set(wd->scr, 0);
}
static Eina_Bool
_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
{
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ Widget_Data *wd = elm_widget_data_get(obj);
double zoom;
Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord page_x = 0;
Evas_Coord page_y = 0;
+ if (!wd) return EINA_FALSE;
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
Evas_Event_Key_Down *ev = event_info;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return EINA_FALSE;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
elm_smart_scroller_child_pos_get(wd->scr, &x, &y);
static Elm_Map_Name *
_utils_convert_name(const Evas_Object *obj, int method, char *address, double lon, double lat)
{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
-
char buf[PATH_MAX];
char *source;
int fd;
+
+ if (!wd) return NULL;
Elm_Map_Name *name = ELM_NEW(Elm_Map_Name);
if (!name) return NULL;
evas_object_smart_callback_add(wd->scr, "scroll", _scr, obj);
evas_object_smart_callback_add(wd->scr, "drag", _scr, obj);
elm_widget_resize_object_set(obj, wd->scr);
+ elm_smart_scroller_wheel_disabled_set(wd->scr, EINA_TRUE);
evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
evas_object_smart_callback_add(wd->scr, "animate,stop", _scr_anim_stop, obj);
_mouse_multi_move, obj);
evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_UP,
_mouse_multi_up, obj);
+ evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_WHEEL,
+ _mouse_wheel_cb, obj);
evas_object_smart_member_add(wd->rect, wd->pan_smart);
elm_widget_sub_object_add(obj, wd->rect);
wd->t_start = ecore_loop_time_get();
wd->t_end = wd->t_start + _elm_config->zoom_friction;
+ if ((wd->size.w > 0) && (wd->size.h > 0))
+ {
+ wd->size.spos.x = (double)(rx + (rw / 2)) / (double)wd->size.ow;
+ wd->size.spos.y = (double)(ry + (rh / 2)) / (double)wd->size.oh;
+ }
+ else
+ {
+ wd->size.spos.x = 0.5;
+ wd->size.spos.y = 0.5;
+ }
+ if (rw > wd->size.ow) wd->size.spos.x = 0.5;
+ if (rh > wd->size.oh) wd->size.spos.y = 0.5;
+ if (wd->size.spos.x > 1.0) wd->size.spos.x = 1.0;
+ if (wd->size.spos.y > 1.0) wd->size.spos.y = 1.0;
+
if (wd->paused)
{
zoom_do(obj);
{
ELM_CHECK_WIDTYPE(obj, widtype) 1.0;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return 1.0;
return wd->zoom;
}
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
if (wd->mode == mode) return;
wd->mode = mode;
{
ELM_CHECK_WIDTYPE(obj, widtype) ELM_MAP_ZOOM_MODE_MANUAL;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return ELM_MAP_ZOOM_MODE_MANUAL;
return wd->mode;
}
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
if (wd->paused == !!paused) return;
wd->paused = paused;
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
if (wd->paused_markers == !!paused) return;
wd->paused_markers = paused;
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return EINA_FALSE;
return wd->paused;
}
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return EINA_FALSE;
return wd->paused_markers;
}
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
+ if (!wd) return;
if (try_num)
{
*try_num = wd->try_num;
EAPI void
elm_map_utils_convert_coord_into_geo(const Evas_Object *obj, int x, int y, int size, double *lon, double *lat)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd) return;
int zoom = floor(log(size/256) / log(2));
if (elm_map_source_get(obj) == ELM_MAP_SOURCE_MODULE)
EAPI void
elm_map_utils_convert_geo_into_coord(const Evas_Object *obj, double lon, double lat, int size, int *x, int *y)
{
+ ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd) return;
int zoom = floor(log(size/256) / log(2));
if (elm_map_source_get(obj) == ELM_MAP_SOURCE_MODULE)
EAPI Elm_Map_Marker *
elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Class *clas, Elm_Map_Group_Class *clas_group, void *data)
{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
int i, j;
Eina_List *l;
Marker_Group *group;
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
int mpi, mpj;
int tabi[9];
int tabj[9];
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
wd->markers_max_num = max;
}
Widget_Data *wd = elm_widget_data_get(obj);
Marker_Group *group;
Eina_List *l, *l_next;
+
if (!wd) return;
EINA_LIST_FOREACH_SAFE(wd->opened_bubbles, l, l_next, group)
_group_bubble_free(group);
}
-
/**
* Create a group class.
*
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return NULL;
Elm_Map_Group_Class *clas = calloc(1, sizeof(Elm_Map_Group_Class));
clas->zoom_grouped = ZOOM_MAX;
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
EINA_SAFETY_ON_NULL_RETURN(clas);
if (clas->hide == hide) return;
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return NULL;
Elm_Map_Marker_Class *clas = calloc(1, sizeof(Elm_Map_Marker_Class));
wd->markers_clas = eina_list_append(wd->markers_clas, clas);
Grid *grid;
int zoom;
Mod_Api *api = NULL;
+
if (!wd) return;
_elm_config_sub_init();
if (source == ELM_MAP_SOURCE_MODULE)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
wd->source = source;
}
{
ELM_CHECK_WIDTYPE(obj, widtype) ELM_MAP_SOURCE_MAPNIK;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return ELM_MAP_SOURCE_MAPNIK;
return wd->source;
}
{
ELM_CHECK_WIDTYPE(obj, widtype) ELM_MAP_ROUTE_SOURCE_YOURS;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return ELM_MAP_ROUTE_SOURCE_YOURS;
return wd->route_source;
}
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return EINA_FALSE;
+
+ if (!wd) return NULL;
char buf[PATH_MAX];
char *source;
char *type_name = NULL;
* This gets the current coordinates of the name object.
*
* @param obj The name object
- * @param lat The latitude.
- * @param lon The longitude.
+ * @param lat The latitude
+ * @param lon The longitude
*
* @ingroup Map
*/
* Set the rotate degree of the map
*
* @param obj The map object
- * @param angle amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
- * @param cx rotation's center horizontal position.
- * @param cy rotation's center vertical position.
+ * @param angle amount of degrees from 0.0 to 360.0 to rotate arount Z axis
+ * @param cx rotation's center horizontal position
+ * @param cy rotation's center vertical position
*
* @ingroup Map
*/
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
wd->rotate.d = degree;
wd->rotate.cx = cx;
wd->rotate.cy = cy;
* Get the rotate degree of the map
*
* @param obj The map object
- * @return amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
- * @param cx rotation's center horizontal position.
- * @param cy rotation's center vertical position.
+ * @return amount of degrees from 0.0 to 360.0 to rotate arount Z axis
+ * @param cx rotation's center horizontal position
+ * @param cy rotation's center vertical position
*
* @ingroup Map
*/
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
if (degree) *degree = wd->rotate.d;
if (cx) *cx = wd->rotate.cx;
if (cy) *cy = wd->rotate.cy;
}
+/**
+ * Set the wheel control state of the map
+ *
+ * @param obj The map object
+ * @param disabled status of wheel control
+ *
+ * @ingroup Map
+ */
+EAPI void
+elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd) return;
+ if ((!wd->wheel_disabled) && (disabled))
+ evas_object_event_callback_del_full(wd->rect, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, obj);
+ else if ((wd->wheel_disabled) && (!disabled))
+ evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, obj);
+ wd->wheel_disabled = disabled;
+}
+
+/**
+ * Get the wheel control state of the map
+ *
+ * @param obj The map object
+ * @return Returns the status of wheel control
+ *
+ * @ingroup Map
+ */
+EAPI Eina_Bool
+elm_map_wheel_disabled_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd) return EINA_FALSE;
+ return wd->wheel_disabled;
+}
+
static char *
_mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
{
static char *
_nominatim_url_cb(Evas_Object *obj, int method, char *name, double lon, double lat)
{
+ ELM_CHECK_WIDTYPE(obj, widtype) strdup("");
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return strdup("");
char **str;
unsigned int ele, idx;
-
char search_url[PATH_MAX];
char buf[PATH_MAX];
+
+ if (!wd) return strdup("");
if (method == ELM_MAP_NAME_METHOD_SEARCH)
{
search_url[0] = '\0';