From: chanywa Date: Fri, 10 Feb 2017 10:50:10 +0000 (+0900) Subject: add APIs to set and get scale of the whole map X-Git-Tag: submit/tizen/20170213.034030^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d646835ebde2df69213f84a51fc2761d39ad12c;p=platform%2Fcore%2Flocation%2Fmaps-plugin-here.git add APIs to set and get scale of the whole map Change-Id: I2ae70488c940e6d660059ce18fb303e61479157b --- diff --git a/inc/engine/maps/GeoTiledMap.h b/inc/engine/maps/GeoTiledMap.h index ed8af45..126ad22 100755 --- a/inc/engine/maps/GeoTiledMap.h +++ b/inc/engine/maps/GeoTiledMap.h @@ -59,7 +59,7 @@ class GeoProviderManager; * to control the map size, orientation (heading), zoom level, and managing * objects such as markers, polylines and polygons that can be superimposed on * the map. - * + * * \ingroup maps */ class EXPORT_API GeoTiledMap @@ -75,7 +75,7 @@ public: /// day map. MT_Satellite_Day, ///< Indicates a satellite day map. MT_Terrain_Day, ///< Indicates a terrain day map. - MT_Hybrid_Day, ///< Indicates a hybrid day map + MT_Hybrid_Day, ///< Indicates a hybrid day map /// (satellite, with roads and labels). #ifdef TIZEN_MIGRATION MT_Normal_Day_Grey, @@ -106,7 +106,7 @@ public: MT_Carnav_Day_Grey, #endif MT_Last_Entry_Undefined ///< Indicates that the map type is not - /// defined. + /// defined. }; /** @@ -130,7 +130,7 @@ public: /** * This method sets the size of the map. - * + * * @param size A constant reference to an object specifying the size of the * map in pixels (width and height). */ @@ -146,7 +146,7 @@ public: /** * This method sets the map zoom level. - * + * * @param zoomLevel A value indicating the new zoom level. */ #ifdef TIZEN_MIGRATION @@ -154,21 +154,21 @@ public: #else void SetZoomLevel(double zoomLevel); #endif - + /** * This method retrieves the map zoom level. * * @return A value indicating the new zoom level. */ double GetZoomLevel() const; - + /** * This method retrieves the minimum map zoom level. * * @return A value indicating the minimum map zoom level. */ double GetMinimumZoomLevel() const; - + #ifdef TIZEN_CUSTOMIZATION /** * This method sets the minimum map zoom level. @@ -193,7 +193,7 @@ public: */ void SetMaximumZoomLevel(double zoomLevel); #endif - + /** * This method pans the map the caller-specified number of pixels * horizontally and vertically. @@ -207,16 +207,16 @@ public: void Pan(int dx, int dy); /** - * This method sets the coordinates of the map center. - * + * This method sets the coordinates of the map center. + * * @param center A constant reference to an object containing the new * geographic coordinates of the map center. */ void SetCenter(const GeoCoordinates& center); /** - * This method retrieves the coordinates of the map center. - * + * This method retrieves the coordinates of the map center. + * * @return A constant reference to an object containing the * geographic coordinates of the map center. */ @@ -231,7 +231,7 @@ public: /** * This method invalidates (discards) all the map objects, including - * markers. + * markers. */ void InvalidateMapObjects(); @@ -249,7 +249,7 @@ public: /** * This method clears all the map objects associated with the given tiled - * map object. + * map object. */ void ClearMapObjects(); @@ -257,10 +257,10 @@ public: * This method converts the geographic location specified by the caller to * screen coordinates, taking into consideration the current zoom level and * the view area. - * + * * @param coordinate A constant reference to an object containing the * coordinates to convert. - * + * * @return An object containing the x and y coordinates defining the screen * location. */ @@ -270,10 +270,10 @@ public: * This method converts the screen position specified by the caller to * geographic coordinates. The method is called, for example, when a marker * is being added to the map. - * + * * @param screenPosition An object containing the x and y coordinates * defining the screen location to convert. - * + * * @return An object containing the geographic coordinates of corresponding * to the received screen position. */ @@ -283,10 +283,10 @@ public: /** * This method adds an object to the map. The object is a marker, a polygon * or polyline, or a group of objects. - * + * * @param obj A pointer to an object to add to the map. If the object does * not exist (is NULL), the method has no effect. - * + * * @param bTransferOwnership A Boolean value indicating if the ownership of * the map object given in the first parameter should be transferred * to this map instance (true, default) or not @@ -297,11 +297,11 @@ public: void AddObject(GeoMapObject* obj, bool bTransferOwnership=true); /** - * This method removes the object specified by the caller from the map. - * + * This method removes the object specified by the caller from the map. + * * @param obj A pointer to the object to remove from the map. If the object * does not exist (is NULL), the method has no effect. - * + * * @return Boolean value indicating if the removal of the object was * successful (true) or not (false). */ @@ -310,10 +310,10 @@ public: /** * This method obtains a pointer to the map object located at the screen * position indicated by the caller. - * + * * @param point A constant reference to an object containing the pixel * coordinates of the screen position from which to get the map object. - * + * * @return A pointer to the map object at the specified screen location, * otherwise NULL if no map object is found. */ @@ -321,7 +321,7 @@ public: /** * This method obtains a count of marker objects in the given tiled map. - * + * * @return A value that indicates the number of marker objects. */ size_t GetNumMarkerObjects() const; @@ -329,10 +329,10 @@ public: /** * This method retrieves a pointer to a marker object at the index specified * by the caller. - * + * * @param idx A value specifying the index of the marker object to - * retrieve. - * + * retrieve. + * * @return A pointer to the marker object at the specified index or * NULL if the index is invalid. */ @@ -343,11 +343,11 @@ public: * This method draws (renders and displays) a map image of the size * specified by the caller. The displayed map includes the required map * tiles as well as any objects such as markers, polygons and polylines. - * + * * @param uWidth A value specifying the width of the map image. - * - * @param uHeight A value specifying the height of the map image. - * + * + * @param uHeight A value specifying the height of the map image. + * * @return A Boolean, true if the map has been successfully * pained, otherwise false. */ @@ -366,23 +366,23 @@ public: /** * This method sets a callback to be invoked when the map has - * been updated. - * + * been updated. + * * @param slot A function object to be called when the map has - * been updated. + * been updated. */ void SetUpdateMapSignal(UpdateMapSignalFunctor slot); /** * This method sets the map type. - * + * * @param aMapType A value indicating the new map type. */ void SetMapType(MapType aMapType); /** * This method retrieves the map type. - * + * * @return A value indicating the current map type. */ MapType GetMapType() const; @@ -392,8 +392,8 @@ public: * L"ara", L"chi", L"cht", L"dut", L"eng", L"ger", L"gle", L"fre", L"ita", L"spa", L"rus", L"pol", L"gre", L"wel" */ /** - * This method sets the language of the map. - * + * This method sets the language of the map. + * * @param aMapLanguage A constant reference to a string containing a * language code. The value of the string must be one of "ara" * (Arabic), "chi" (Chinese), "cht" (Chinese-Taiwan), "dut" (Dutch), @@ -404,8 +404,8 @@ public: void SetMapLanguage(const String& aMapLanguage); /** - * This method retrieves the current language of the map. - * + * This method retrieves the current language of the map. + * * @return A constant reference to a string containing the language code, * which is one of "ara" (Arabic), "chi" (Chinese), "cht" * (Chinese-Taiwan), "dut" (Dutch), "eng" (English), "ger" (German), @@ -424,7 +424,7 @@ public: /** * This method retrieves the size of the tiles, used for rendering the map. - * + * * @return An unsigned integer indicating the size of the map tiles. */ unsigned int GetTileSize() const; @@ -432,7 +432,7 @@ public: /** * This method changes the background color of the map. * The background color is updated after refreshing the map. - * + * * @param color A constant reference to an object representing the new map * background color. */ @@ -441,7 +441,7 @@ public: #ifdef TIZEN_CUSTOMIZATION /** * This method retrieves the root tile, used for rendering the map. - * + * * @return An pointer indicating the bitmap of the root tile. */ DrawableBitmapPtr GetRootPixmap() const; @@ -449,8 +449,8 @@ public: /** * This method sets a pointer of a structure of the Evas GL API object that * contains the GL APIs to be used in Evas GL. - * - * @param __glapi A pointer to a structure of the Evas GL API object. + * + * @param __glapi A pointer to a structure of the Evas GL API object. */ void SetEvasGlApi(Evas_GL_API *__glapi); @@ -506,6 +506,20 @@ public: * @param yFactor The propotional y-position of the logo [0.0~1.0]. */ void SetLogoPosition(double xFactor, double yFactor); + + /** + * This method retrieves the scale of the whole map. + * + * @return A value indicating the scale of the whole map. + */ + double GetScale(); + + /** + * This method sets the scale of the whole map view. + * + * @return scale The scale of the whole map view. + */ + void SetScale(double scale); #endif #ifdef TIZEN_SUPPORT_TILE_FILE_CACHE diff --git a/inc/here_api.h b/inc/here_api.h index 458ffee..6b05e72 100644 --- a/inc/here_api.h +++ b/inc/here_api.h @@ -111,4 +111,8 @@ int HerePluginCaptureSnapshot(maps_view_h hView, void **data, int *w, int *h, ma int HerePluginCheckUC(const char *provider, maps_service_request_user_consent_cb pCbFunc, void *user_data); +int HerePluginGetViewScale(maps_view_h hView, double *scale); + +int HerePluginSetViewScale(maps_view_h hView, double scale); + #endif //_LOCATION_HERE_API_H_ \ No newline at end of file diff --git a/inc/here_view.h b/inc/here_view.h index 6a5974c..cb6dc91 100644 --- a/inc/here_view.h +++ b/inc/here_view.h @@ -66,6 +66,8 @@ public: here_error_e getMaxZoomLevel(maps_view_h view, int *zoom); here_error_e onViewObject(maps_view_h view, const maps_view_object_h object, maps_view_object_operation_e operation); + here_error_e getViewScale(maps_view_h view, double *scale); + here_error_e setViewScale(maps_view_h view, double scale); private: here_error_e initOpenGL(); diff --git a/lib/aarch64/libheremaps-engine.so.1 b/lib/aarch64/libheremaps-engine.so.1 index 428b381..4f08173 120000 --- a/lib/aarch64/libheremaps-engine.so.1 +++ b/lib/aarch64/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_26 \ No newline at end of file +libheremaps-engine.so.1.0.6_28 \ No newline at end of file diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_26 b/lib/aarch64/libheremaps-engine.so.1.0.6_26 deleted file mode 100755 index 2e6398e..0000000 Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_26 and /dev/null differ diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_28 b/lib/aarch64/libheremaps-engine.so.1.0.6_28 new file mode 100755 index 0000000..bf237da Binary files /dev/null and b/lib/aarch64/libheremaps-engine.so.1.0.6_28 differ diff --git a/lib/arm/libheremaps-engine.so.1 b/lib/arm/libheremaps-engine.so.1 index 428b381..4f08173 120000 --- a/lib/arm/libheremaps-engine.so.1 +++ b/lib/arm/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_26 \ No newline at end of file +libheremaps-engine.so.1.0.6_28 \ No newline at end of file diff --git a/lib/arm/libheremaps-engine.so.1.0.6_26 b/lib/arm/libheremaps-engine.so.1.0.6_26 deleted file mode 100755 index 281bdda..0000000 Binary files a/lib/arm/libheremaps-engine.so.1.0.6_26 and /dev/null differ diff --git a/lib/arm/libheremaps-engine.so.1.0.6_28 b/lib/arm/libheremaps-engine.so.1.0.6_28 new file mode 100755 index 0000000..aad4267 Binary files /dev/null and b/lib/arm/libheremaps-engine.so.1.0.6_28 differ diff --git a/lib/i586/libheremaps-engine.so.1 b/lib/i586/libheremaps-engine.so.1 index 428b381..4f08173 120000 --- a/lib/i586/libheremaps-engine.so.1 +++ b/lib/i586/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_26 \ No newline at end of file +libheremaps-engine.so.1.0.6_28 \ No newline at end of file diff --git a/lib/i586/libheremaps-engine.so.1.0.6_26 b/lib/i586/libheremaps-engine.so.1.0.6_26 deleted file mode 100755 index 27ef629..0000000 Binary files a/lib/i586/libheremaps-engine.so.1.0.6_26 and /dev/null differ diff --git a/lib/i586/libheremaps-engine.so.1.0.6_28 b/lib/i586/libheremaps-engine.so.1.0.6_28 new file mode 100755 index 0000000..9fcd612 Binary files /dev/null and b/lib/i586/libheremaps-engine.so.1.0.6_28 differ diff --git a/lib/x86_64/libheremaps-engine.so.1 b/lib/x86_64/libheremaps-engine.so.1 index 428b381..4f08173 120000 --- a/lib/x86_64/libheremaps-engine.so.1 +++ b/lib/x86_64/libheremaps-engine.so.1 @@ -1 +1 @@ -libheremaps-engine.so.1.0.6_26 \ No newline at end of file +libheremaps-engine.so.1.0.6_28 \ No newline at end of file diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_26 b/lib/x86_64/libheremaps-engine.so.1.0.6_26 deleted file mode 100755 index bf3c7d3..0000000 Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_26 and /dev/null differ diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_28 b/lib/x86_64/libheremaps-engine.so.1.0.6_28 new file mode 100755 index 0000000..9fdc97d Binary files /dev/null and b/lib/x86_64/libheremaps-engine.so.1.0.6_28 differ diff --git a/maps-plugin-here.changes b/maps-plugin-here.changes index 1fcd89b..b21a418 100644 --- a/maps-plugin-here.changes +++ b/maps-plugin-here.changes @@ -1,3 +1,8 @@ +[Version] maps-plugin-here_0.3.16 +[Date] 10 Feb 2017 +[Title] add APIs to set and get scale of the whole map +[Developer] Seechan Kim + [Version] maps-plugin-here_0.3.15 [Date] 13 Jan 2017 [Title] fixed to set vconf value diff --git a/packaging/maps-plugin-here.spec b/packaging/maps-plugin-here.spec index 4f03f49..050e327 100644 --- a/packaging/maps-plugin-here.spec +++ b/packaging/maps-plugin-here.spec @@ -1,6 +1,6 @@ Name: maps-plugin-here Summary: Tizen HERE Maps Plug-in Library -Version: 0.3.15 +Version: 0.3.16 Release: 1 Group: Location/Libraries License: Apache-2.0 and HERE diff --git a/src/here_api.cpp b/src/here_api.cpp index b3fbd9a..25ba368 100644 --- a/src/here_api.cpp +++ b/src/here_api.cpp @@ -876,3 +876,23 @@ int HerePluginCheckUC(const char *provider, maps_service_request_user_consent_cb return HERE_ERROR_NONE; } +int HerePluginGetViewScale(maps_view_h hView, double *scale) +{ + HereView *vh = NULL; + int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh); + here_error_e error = (here_error_e)ConvertToHereError(maps_error); + if (error == HERE_ERROR_NONE && vh) + error = vh->getViewScale(hView, scale); + return error; +} + +int HerePluginSetViewScale(maps_view_h hView, double scale) +{ + HereView *vh = NULL; + int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh); + here_error_e error = (here_error_e)ConvertToHereError(maps_error); + if (error == HERE_ERROR_NONE && vh) + error = vh->setViewScale(hView, scale); + return error; +} + diff --git a/src/here_plugin.cpp b/src/here_plugin.cpp index 33a5ac0..e16e5a7 100644 --- a/src/here_plugin.cpp +++ b/src/here_plugin.cpp @@ -414,5 +414,18 @@ EXPORT_API int maps_plugin_capture_snapshot(maps_view_h view, void **data, return ConvertToMapsError(ret); } + +EXPORT_API int maps_plugin_get_view_scale_factor(maps_view_h hView, double *scale) +{ + int ret = HerePluginGetViewScale(hView, scale); + return ConvertToMapsError(ret); +} + +EXPORT_API int maps_plugin_set_view_scale_factor(maps_view_h hView, double scale) +{ + int ret = HerePluginSetViewScale(hView, scale); + return ConvertToMapsError(ret); +} + } // end of extern "C" diff --git a/src/here_view.cpp b/src/here_view.cpp index b18f4d9..f5e1f5c 100644 --- a/src/here_view.cpp +++ b/src/here_view.cpp @@ -552,4 +552,30 @@ here_error_e HereView::captureSnapshot(maps_view_h view, void **data, int *width return HERE_ERROR_NONE; } +here_error_e HereView::getViewScale(maps_view_h view, double *scale) +{ + if (!view || !scale) + return HERE_ERROR_INVALID_PARAMETER; + + if (!__isInitialized || !__map) + return HERE_ERROR_SERVICE_NOT_AVAILABLE; + + *scale = __map->GetScale(); + + return HERE_ERROR_NONE; +} + +here_error_e HereView::setViewScale(maps_view_h view, double scale) +{ + if (!view) + return HERE_ERROR_INVALID_PARAMETER; + + if (!__isInitialized || !__map) + return HERE_ERROR_SERVICE_NOT_AVAILABLE; + + __map->SetScale(scale); + + return HERE_ERROR_NONE; +} + HERE_PLUGIN_END_NAMESPACE