return MAPS_ERROR_INVALID_PARAMETER;
/* Set new polyline trajectory */
- maps_coordinates_list_destroy(p->points);
- p->points = points;
+ if (p->points != points) {
+ maps_coordinates_list_destroy(p->points);
+ p->points = points;
+ }
/* Notify view, that the object specific preferences is changed */
_maps_view_on_object_operation(__get_view(polyline), polyline, MAPS_VIEW_OBJECT_CHANGE);
return MAPS_ERROR_INVALID_PARAMETER;
/* Set new polygon border */
- maps_coordinates_list_destroy(p->points);
- p->points = points;
+ if (p->points != points) {
+ maps_coordinates_list_destroy(p->points);
+ p->points = points;
+ }
/* Notify view, that the object specific preferences is changed */
_maps_view_on_object_operation(__get_view(polygon), polygon, MAPS_VIEW_OBJECT_CHANGE);
maps_view_marker_data_s *m = __get_marker_data(marker);
if (!m)
return MAPS_ERROR_INVALID_PARAMETER;
- if (m->coordinates)
+
+ /* Set new coordinates */
+ if (m->coordinates != coordinates) {
maps_coordinates_destroy(m->coordinates);
- m->coordinates = coordinates;
+ m->coordinates = coordinates;
+ }
/* Notify view, that the object specific preferences is changed */
_maps_view_on_object_operation(__get_view(marker), marker, MAPS_VIEW_OBJECT_CHANGE);
maps_view_overlay_data_s *m = __get_overlay_data(overlay);
if (!m)
return MAPS_ERROR_INVALID_PARAMETER;
- if (m->coordinates)
+
+ if (m->coordinates != coordinates) {
maps_coordinates_destroy(m->coordinates);
- m->coordinates = coordinates;
+ m->coordinates = coordinates;
+ }
/* Notify view, that the object specific preferences is changed */
_maps_view_on_object_operation(__get_view(overlay), overlay, MAPS_VIEW_OBJECT_CHANGE);