fixed about path data of routing result 33/82433/5
authorchanywa <cbible.kim@samsung.com>
Wed, 3 Aug 2016 09:17:59 +0000 (18:17 +0900)
committerchanywa <cbible.kim@samsung.com>
Wed, 3 Aug 2016 11:07:22 +0000 (20:07 +0900)
Change-Id: If1b3b25d07debbf6e46e2c6af32bff628baf42c9

inc/here_api.h [changed mode: 0755->0644]
inc/here_multirevgeocode.h [changed mode: 0755->0644]
inc/here_route.h
maps-plugin-here.changes
packaging/maps-plugin-here.spec
src/here_multirevgeocode.cpp [changed mode: 0755->0644]
src/here_route.cpp
src/here_view.cpp [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8c352e1..bea9d71 100644 (file)
@@ -63,10 +63,13 @@ public:
 
 private:
        maps_error_e ProcessSegments(maps_route_h mapsRoute, const RouteSegmentList& hereSegmList);
+       maps_error_e ProcessSegmentsPath(maps_route_segment_h mapsSegm, const GeoCoordinateList &herePathList);
        maps_error_e ProcessManeuver(maps_route_segment_h mapsSegm, const ManeuverList& hereManeList);
        const double __convertDistanceUnit(const double dValue);
 
        maps_distance_unit_e m_eDistanceUnit;
+       maps_coordinates_h m_aOriginCoord;
+       maps_coordinates_h m_aDestinationCoord;
        GeoRouteQuery* m_pQuery;
 };
 
index 16d4ea6..c60f69a 100644 (file)
@@ -1,3 +1,8 @@
+[Version]   maps-plugin-here_0.3.3
+[Date]      03 Aug 2016
+[Title]     Fixed some problems related with path data of routing
+[Developer] Seechan Kim <cbible.kim@samsung.com>
+
 [Version]   maps-plugin-here_0.3.2
 [Date]      07 June 2016
 [Title]     modified internal APIs for maps-service
index 442dc7b..12bf472 100644 (file)
@@ -1,6 +1,6 @@
 Name:       maps-plugin-here
 Summary:    Tizen HERE Maps Plug-in Library
-Version:    0.3.2
+Version:    0.3.3
 Release:    1
 Group:      Location/Libraries
 License:    Apache-2.0 and HERE
@@ -116,7 +116,7 @@ Summary:    HereMpas-UC Launcher deamon
 Requires:   %{name} = %{version}-%{release}
 
 %description -n heremaps-uc-launcher
-This package is for launching the org.tizen.heremaps-uc application. 
+This package is for launching the org.tizen.heremaps-uc application.
 
 %files -n heremaps-uc-launcher
 %manifest heremaps-uc-launcher/heremaps-uc-launcher.manifest
old mode 100755 (executable)
new mode 100644 (file)
index b3f2228..7b3e2b5 100644 (file)
@@ -27,6 +27,8 @@ HereRoute::HereRoute(void *pCbFunc, void *pUserData, int nReqId)
        m_nReqId = nReqId;
 
        m_eDistanceUnit = MAPS_DISTANCE_UNIT_M;
+       m_aOriginCoord = NULL;
+       m_aDestinationCoord = NULL;
 }
 
 HereRoute::~HereRoute()
@@ -35,6 +37,8 @@ HereRoute::~HereRoute()
                delete m_pQuery;
                m_pQuery = NULL;
        }
+       maps_coordinates_destroy(m_aOriginCoord);
+       maps_coordinates_destroy(m_aDestinationCoord);
 }
 
 here_error_e HereRoute::PrepareQuery()
@@ -65,6 +69,12 @@ here_error_e HereRoute::PrepareWaypoint(maps_coordinates_h hOrigin, maps_coordin
        hWaypointList[0] = hOrigin;
        hWaypointList[1] = hDestination;
 
+       maps_coordinates_destroy(m_aOriginCoord);
+       maps_coordinates_destroy(m_aDestinationCoord);
+
+       maps_coordinates_clone(hOrigin, &m_aOriginCoord);
+       maps_coordinates_clone(hDestination, &m_aDestinationCoord);
+
        return PrepareWaypoint(hWaypointList, nWaypointNum);
 }
 
@@ -258,6 +268,9 @@ void HereRoute::OnRouteReply(const GeoRouteReply& Reply)
                        maps_item_list_h mapsPathList;
                        maps_coordinates_h mapsPath;
 
+                       maps_route_set_origin(mapsRoute, m_aOriginCoord);
+                       maps_route_set_destination(mapsRoute, m_aDestinationCoord);
+
                        if (maps_item_list_create(&mapsPathList) == MAPS_ERROR_NONE) {
                                GeoCoordinateList::iterator herePath;
                                for (herePath = herePathList.begin(); herePath != herePathList.end(); herePath++) {
@@ -265,13 +278,7 @@ void HereRoute::OnRouteReply(const GeoRouteReply& Reply)
                                        double dLng = herePath->GetLongitude();
 
                                        if(maps_coordinates_create(dLat, dLng, &mapsPath) == MAPS_ERROR_NONE) {
-                                               if (herePath == herePathList.begin())
-                                                       maps_route_set_origin(mapsRoute, mapsPath);
-                                               else if (herePath == herePathList.end()-1)
-                                                       maps_route_set_destination(mapsRoute, mapsPath);
-                                               else
-                                                       maps_item_list_append(mapsPathList, mapsPath, maps_coordinates_clone);
-
+                                               maps_item_list_append(mapsPathList, mapsPath, maps_coordinates_clone);
                                                maps_coordinates_destroy(mapsPath);
                                        }
                                }
@@ -342,24 +349,8 @@ maps_error_e HereRoute::ProcessSegments(maps_route_h mapsRoute, const RouteSegme
                /* tranvel time */
                maps_route_segment_set_duration(mapsSegm, hereSegm->GetTravelTime());
 
-               /* origin, destination */
-               GeoCoordinateList herePathList = hereSegm->GetPath();
-               int here_path_list_size = herePathList.size();
-
-               if (here_path_list_size > 0) {
-                       GeoCoordinates hereOrig = herePathList.at(0);
-                       GeoCoordinates hereDest = herePathList.at(here_path_list_size-1);
-
-                       maps_coordinates_h mapsOrig, mapsDest;
-                       maps_coordinates_create(hereOrig.GetLatitude(),
-                                               hereOrig.GetLongitude(), &mapsOrig);
-                       maps_coordinates_create(hereDest.GetLatitude(),
-                                               hereDest.GetLongitude(), &mapsDest);
-                       maps_route_segment_set_origin(mapsSegm, mapsOrig);
-                       maps_route_segment_set_destination(mapsSegm, mapsDest);
-                       maps_coordinates_destroy(mapsOrig);
-                       maps_coordinates_destroy(mapsDest);
-               }
+               /* origin, destination and path */
+               ProcessSegmentsPath(mapsSegm, hereSegm->GetPath());
 
                /* maneuver */
                ProcessManeuver(mapsSegm, hereSegm->GetManeuverList());
@@ -377,6 +368,40 @@ maps_error_e HereRoute::ProcessSegments(maps_route_h mapsRoute, const RouteSegme
        return MAPS_ERROR_NONE;
 }
 
+maps_error_e HereRoute::ProcessSegmentsPath(maps_route_segment_h mapsSegm, const GeoCoordinateList &herePathList)
+{
+       int herePathListSize = herePathList.size();
+       GeoCoordinates hereCoord;
+       maps_coordinates_h mapsCoord;
+       maps_item_list_h mapsPathList;
+       maps_error_e error;
+
+       if ((error = (maps_error_e)maps_item_list_create(&mapsPathList)) != MAPS_ERROR_NONE)
+               return error;
+
+       for (int i = 0; i < herePathListSize; i++) {
+               hereCoord = herePathList.at(i);
+               mapsCoord = NULL;
+               maps_coordinates_create(hereCoord.GetLatitude(), hereCoord.GetLongitude(), &mapsCoord);
+               if (mapsCoord) {
+                       if (i == 0)
+                               maps_route_segment_set_origin(mapsSegm, mapsCoord);
+                       if (i == herePathListSize - 1)
+                               maps_route_segment_set_destination(mapsSegm, mapsCoord);
+                       maps_item_list_append(mapsPathList, mapsCoord, maps_coordinates_clone);
+                       maps_coordinates_destroy(mapsCoord);
+               }
+       }
+
+       if (maps_item_list_items(mapsPathList)) {
+               maps_route_segment_set_path(mapsSegm, mapsPathList);
+               maps_item_list_remove_all(mapsPathList, maps_coordinates_destroy);
+       }
+       maps_item_list_destroy(mapsPathList);
+
+       return MAPS_ERROR_NONE;
+}
+
 maps_error_e HereRoute::ProcessManeuver(maps_route_segment_h mapsSegm, const ManeuverList& hereManeList)
 {
        maps_item_list_h mapsManeList;
old mode 100755 (executable)
new mode 100644 (file)