fix for using maps_view_handle in maps_plugin 47/68447/4 accepted/tizen/common/20160517.174354 accepted/tizen/ivi/20160517.083335 accepted/tizen/ivi/20160518.004341 accepted/tizen/mobile/20160517.083352 accepted/tizen/mobile/20160518.004454 accepted/tizen/tv/20160517.083248 accepted/tizen/tv/20160518.004348 accepted/tizen/wearable/20160517.083319 accepted/tizen/wearable/20160518.004336 submit/tizen/20160517.035309 submit/tizen/20160517.093728
authorjongmun.woo <jongmun.woo@samsung.com>
Wed, 4 May 2016 09:07:14 +0000 (18:07 +0900)
committerjongmun.woo <jongmun.woo@samsung.com>
Mon, 16 May 2016 08:57:07 +0000 (17:57 +0900)
Signed-off-by: jongmun.woo <jongmun.woo@samsung.com>
Change-Id: I0e30e5690e0d125e5ab10e179fd30f2d80764138

inc/engine/common/ApplicationContext.h
inc/engine/maps/GeoTiledMap.h
inc/here_api.h
inc/here_view.h
lib/aarch64/libheremaps-engine.so.1.0.6_13
lib/arm/libheremaps-engine.so.1.0.6_13
lib/i586/libheremaps-engine.so.1.0.6_13
lib/x86_64/libheremaps-engine.so.1.0.6_13
src/here_api.cpp
src/here_plugin.cpp
src/here_view.cpp

index 4f4fa6b..2ac89f7 100755 (executable)
@@ -70,12 +70,14 @@ public:
      */
     const String& GetAppId() const;
 
+#ifdef TIZEN_MIGRATION
     /**
      * This method retrieves the request app id.
      *
      * @return A constant reference to a string containing the request app id.
      */
     const String& GetRequestAppId() const;
+#endif
 
     /**
      * This is a static method which returns the singleton's instance.
@@ -84,6 +86,7 @@ public:
      */
     static ApplicationContext& GetInstance();
 
+#ifdef TIZEN_MIGRATION
     /**
      * This method initialises the singleton object.
      *
@@ -100,6 +103,22 @@ public:
      *        <code>false</code>.
      */
     bool Initialize(const String& sAppCode, const String& sAppId, const String& sRequestAppId = "");
+#else
+    /**
+     * This method initialises the singleton object.
+     *
+     * @param sAppCode A constant reference to a string containing the app code.
+     *
+     * @param sAppId A constant reference to a string containing the app id.
+     *
+     * @return A Boolean indicating the result of initialization,
+     *        <code>true</code> on success, <code>false</code> on failure. Note
+     *        that if the object already exists and has been initialized,
+     *        further attempts to call this methods fail (the return value is
+     *        <code>false</code>.
+     */
+    bool Initialize(const String& sAppCode, const String& sAppId);
+#endif
 
     /**
      * This method queries initialisation status.
index 9255fe5..f6343db 100755 (executable)
@@ -454,12 +454,13 @@ public:
      */
     void SetEvasGlApi(Evas_GL_API *__glapi);
 
+#ifdef TIZEN_MIGRATION
     /**
      * This typedef defines a function object as a type. The function object can
      * be called when the map has been ready after initialized. A function object of
      * this type returns <code>void</code> and receives no arguments.
      */
-    typedef void(*ReadyMapSignalFunctor)(void);
+    typedef void(*ReadyMapSignalFunctor)(void *data);
 
     /**
      * This method sets a callback to be invoked when the map has
@@ -468,8 +469,25 @@ public:
      * @param slot A function object to be called when the map has
      *        been ready after initialization.
      */
+    void SetReadyMapSignal(ReadyMapSignalFunctor callback, void *data);
+#else
+    /**
+     * This typedef defines a function object as a type. The function object can
+     * be called when the map has been ready after initialized. A function object of
+     * this type returns <code>void</code> and receives no arguments.
+     */
+    typedef void(*ReadyMapSignalFunctor)(void);
+
+    /**
+      * This method sets a callback to be invoked when the map has
+      * been ready after initialization.
+      *
+      * @param slot A function object to be called when the map has
+      *                  been ready after initialization.
+      */
     void SetReadyMapSignal(ReadyMapSignalFunctor callback);
 
+#endif
     /**
      * This method sets the angle of the map.
      *
index ff2d4ea..8342ae3 100644 (file)
@@ -81,35 +81,36 @@ int HerePluginCancelRequest(int nReqId);
 
 /* Mapping API */
 
-int HerePluginSetMapView(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
+int HerePluginCreateMapView(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
 
-int HerePluginRenderMap(const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
+int HerePluginDestroyMapView(maps_view_h hView);
+
+int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
        maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
 
-int HerePluginRenderMapArea(const maps_area_h hArea, const double dZoom, const double dAngle,
+int HerePluginRenderMapArea(maps_view_h hView, const maps_area_h hArea, const double dZoom, const double dAngle,
        maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
 
-int HerePluginMoveCenter(const int delta_x, const int delta_y,
+int HerePluginMoveCenter(maps_view_h hView, const int delta_x, const int delta_y,
        maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
 
-int HerePluginSetScalebar(bool enable);
+int HerePluginSetScalebar(maps_view_h hView, bool enable);
 
-int HerePluginGetScalebar(bool *enabled);
+int HerePluginGetScalebar(maps_view_h hView, bool *enabled);
 
 int HerePluginDrawMap(Evas* pCanvas, const int x, const int y,
        const int nWidth, const int nHeight);
 
-int HerePluginGetCenter(maps_coordinates_h *center);
+int HerePluginGetCenter(maps_view_h hView, maps_coordinates_h *center);
 
-int HerePluginScreenToGeography(const int x, const int y, maps_coordinates_h *mapsCoord);
+int HerePluginScreenToGeography(maps_view_h hView, const int x, const int y, maps_coordinates_h *mapsCoord);
 
-int HerePluginGeographyToScreen(const maps_coordinates_h mapsCoord, int *x, int *y);
+int HerePluginGeographyToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y);
 
-int HerePluginGetMinZoomLevel(int *nMinZoomLevel);
+int HerePluginGetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel);
 
-int HerePluginGetMaxZoomLevel(int *nMaxZoomLevel);
+int HerePluginGetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel);
 
-int HerePluginOnViewObject(const maps_view_object_h object,
-                               const maps_view_object_operation_e operation);
+int HerePluginOnViewObject(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation);
 
 #endif //_LOCATION_HERE_API_H_
\ No newline at end of file
index e7ac400..fd4c0d3 100644 (file)
@@ -27,6 +27,7 @@
 //maps-service header
 #include <maps_service.h>
 #include <maps_view.h>
+#include <maps_view_plugin.h>
 
 //map engine header
 #include <maps/GeoTiledMap.h>
@@ -58,8 +59,6 @@ typedef struct _GLData
        int x, y, w, h;
        double lat, lng, zoom, angle;
 
-       maps_view_h hView;
-
        // to remove // UpdatedObjects updatedObjects;
        HereViewObjects visualObjects;
        PendingObjects pendingObjects;
@@ -76,21 +75,21 @@ public:
        HereView(void *pCbFunc, void *pUserData, int nReqId);
        ~HereView();
 
-       here_error_e Init(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
-       static here_error_e Close();
-       here_error_e RenderMap(const maps_coordinates_h mapsCoord, double dZoom, double dAngle);
-       here_error_e RenderMapByArea(const maps_area_h hArea, double dZoom, double dAngle);
-       static here_error_e DrawMap(Evas* pCanvas, int x, int y, int nWidth, int nHeight);
-       here_error_e MoveCenter(int delta_x, int delta_y);
-       here_error_e SetScalebar(bool enable);
-       here_error_e GetScalebar(bool *enabled);
-       here_error_e GetCenter(maps_coordinates_h *center);
-       here_error_e ScreenToGeolocation(int x, int y, maps_coordinates_h *mapsCoord);
-       here_error_e GeolocationToScreen(const maps_coordinates_h mapsCoord, int *x, int *y);
-
-       static here_error_e GetMinZoomLevel(int *nMinZoomLevel);
-       static here_error_e GetMaxZoomLevel(int *nMaxZoomLevel);
-       static here_error_e OnViewObject(const maps_view_object_h object, maps_view_object_operation_e operation);
+       here_error_e Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
+       static here_error_e Close(maps_view_h hView);
+       here_error_e RenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle);
+       here_error_e RenderMapByArea(maps_view_h hView, const maps_area_h hArea, double dZoom, double dAngle);
+       static here_error_e DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int nWidth, int nHeight);
+       here_error_e MoveCenter(maps_view_h hView, int delta_x, int delta_y);
+       here_error_e SetScalebar(maps_view_h hView, bool enable);
+       here_error_e GetScalebar(maps_view_h hView, bool *enabled);
+       here_error_e GetCenter(maps_view_h hView, maps_coordinates_h *center);
+       here_error_e ScreenToGeolocation(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord);
+       here_error_e GeolocationToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y);
+
+       static here_error_e GetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel);
+       static here_error_e GetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel);
+       static here_error_e OnViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
 
        static void RenderingCb(void *data);
        static bool foreachObject(int index, int total, maps_view_object_h object, void *user_data);
@@ -99,16 +98,14 @@ public:
 private:
 
        here_error_e InitOpenGL(GLData *gld);
-       here_error_e InitOpenGLSurface(GLData *gld);
-       here_error_e InitMap(GLData *gld, maps_plugin_map_view_ready_cb pCbFunc);
-       static void __readyCb();
+       here_error_e InitOpenGLSurface(maps_view_h hView);
+       here_error_e InitMap(maps_view_h hView, GLData *gld, maps_plugin_map_view_ready_cb pCbFunc);
+       static void __readyCb(maps_view_h hView);
        static Eina_Bool __idlerCb(void *data);
        static void __renderingCb(void *data);
        static void __pixelGetCb(void *data, Evas_Object *obj);
-       static void __processViewObject(const maps_view_object_h object, maps_view_object_operation_e operation);
-       void __setMapType();
-
-       static GLData *m_pImpl;
+       static void __processViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
+       void __setMapType(maps_view_h hView);
 
 };
 
index c50cc19..269a3d2 100644 (file)
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_13 and b/lib/aarch64/libheremaps-engine.so.1.0.6_13 differ
index 7329a8a..2252d8e 100644 (file)
Binary files a/lib/arm/libheremaps-engine.so.1.0.6_13 and b/lib/arm/libheremaps-engine.so.1.0.6_13 differ
index 135a916..28273e8 100644 (file)
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_13 and b/lib/i586/libheremaps-engine.so.1.0.6_13 differ
index 4d4c694..17ed2c7 100644 (file)
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_13 and b/lib/x86_64/libheremaps-engine.so.1.0.6_13 differ
index 92630a1..7e6a6db 100644 (file)
@@ -659,9 +659,9 @@ int HerePluginCancelRequest(int nReqId)
        return (HereManager::GetHandler()->CancelInstance(nReqId));
 }
 
-int HerePluginSetMapView(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
+int HerePluginCreateMapView(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
 {
-       if (!HereManager::GetHandler())
+       if (!hView || !HereManager::GetHandler())
                return HERE_ERROR_INVALID_OPERATION;
 
        /* creating instance */
@@ -674,20 +674,39 @@ int HerePluginSetMapView(const maps_view_h hView, maps_plugin_map_view_ready_cb
        /* sending request */
        here_error_e error = HERE_ERROR_NONE;
 
-       if (hView)
-               error = pView->Init(hView, pCbFunc);
-       else
-               error = pView->Close();
+       error = pView->Init(hView, pCbFunc);
 
        delete pView;
 
        return error;
 }
 
-int HerePluginRenderMap(const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
+int HerePluginDestroyMapView(maps_view_h hView)
+{
+       if (!hView || !HereManager::GetHandler())
+               return HERE_ERROR_INVALID_OPERATION;
+
+       /* creating instance */
+       HereView *pView =
+               (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW));
+
+       if(!pView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+
+       /* sending request */
+       here_error_e error = HERE_ERROR_NONE;
+
+       error = pView->Close(hView);
+
+       delete pView;
+
+       return error;
+}
+
+int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
        maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
 {
-       if (!mapsCoord || !pCbFunc || !nReqId)
+       if (!hView || !mapsCoord || !pCbFunc || !nReqId)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -701,16 +720,16 @@ int HerePluginRenderMap(const maps_coordinates_h mapsCoord, const double dZoom,
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->RenderMap(mapsCoord, dZoom, dAngle);
+       here_error_e error = pView->RenderMap(hView, mapsCoord, dZoom, dAngle);
        delete pView;
 
        return error;
 }
 
-int HerePluginRenderMapArea(const maps_area_h hArea, const double dZoom, const double dAngle,
+int HerePluginRenderMapArea(maps_view_h hView, const maps_area_h hArea, const double dZoom, const double dAngle,
        maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
 {
-       if (!hArea || !pCbFunc || !nReqId)
+       if (!hView || !hArea || !pCbFunc || !nReqId)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -724,16 +743,15 @@ int HerePluginRenderMapArea(const maps_area_h hArea, const double dZoom, const d
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->RenderMapByArea(hArea, dZoom, dAngle);
+       here_error_e error = pView->RenderMapByArea(hView, hArea, dZoom, dAngle);
        delete pView;
 
        return error;
 }
 
-int HerePluginMoveCenter(const int delta_x, const int delta_y,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
+int HerePluginMoveCenter(maps_view_h hView, const int delta_x, const int delta_y, maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
 {
-       if (!pCbFunc || !nReqId)
+       if (!hView || !pCbFunc || !nReqId)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -747,15 +765,15 @@ int HerePluginMoveCenter(const int delta_x, const int delta_y,
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->MoveCenter(delta_x, delta_y);
+       here_error_e error = pView->MoveCenter(hView, delta_x, delta_y);
        delete pView;
 
        return error;
 }
 
-int HerePluginSetScalebar(bool enable)
+int HerePluginSetScalebar(maps_view_h hView, bool enable)
 {
-       if (!HereManager::GetHandler())
+       if (!hView || !HereManager::GetHandler())
                return HERE_ERROR_INVALID_OPERATION;
 
        HereView *pView =
@@ -765,15 +783,15 @@ int HerePluginSetScalebar(bool enable)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->SetScalebar(enable);
+       here_error_e error = pView->SetScalebar(hView, enable);
        delete pView;
 
        return error;
 }
 
-int HerePluginGetScalebar(bool *enabled)
+int HerePluginGetScalebar(maps_view_h hView, bool *enabled)
 {
-       if (!enabled)
+       if (!hView || !enabled)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -785,7 +803,7 @@ int HerePluginGetScalebar(bool *enabled)
        if(!pView)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       here_error_e error = pView->GetScalebar(enabled);
+       here_error_e error = pView->GetScalebar(hView, enabled);
        delete pView;
 
        return error;
@@ -797,9 +815,9 @@ int HerePluginDrawMap(Evas* pCanvas, const int x, const int y,
        return HERE_ERROR_NONE;
 }
 
-int HerePluginGetCenter(maps_coordinates_h *center)
+int HerePluginGetCenter(maps_view_h hView, maps_coordinates_h *center)
 {
-       if (!center)
+       if (!hView || !center)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -813,15 +831,15 @@ int HerePluginGetCenter(maps_coordinates_h *center)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->GetCenter(center);
+       here_error_e error = pView->GetCenter(hView, center);
        delete pView;
 
        return error;
 }
 
-int HerePluginScreenToGeography(const int x, const int y, maps_coordinates_h *mapsCoord)
+int HerePluginScreenToGeography(maps_view_h hView, const int x, const int y, maps_coordinates_h *mapsCoord)
 {
-       if (!mapsCoord)
+       if (!hView || !mapsCoord)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -835,15 +853,15 @@ int HerePluginScreenToGeography(const int x, const int y, maps_coordinates_h *ma
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->ScreenToGeolocation(x, y, mapsCoord);
+       here_error_e error = pView->ScreenToGeolocation(hView, x, y, mapsCoord);
        delete pView;
 
        return error;
 }
 
-int HerePluginGeographyToScreen(const maps_coordinates_h mapsCoord, int *x, int *y)
+int HerePluginGeographyToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y)
 {
-       if (!mapsCoord || !x || !y)
+       if (!hView || !mapsCoord || !x || !y)
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (!HereManager::GetHandler())
@@ -857,24 +875,32 @@ int HerePluginGeographyToScreen(const maps_coordinates_h mapsCoord, int *x, int
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        /* sending request */
-       here_error_e error = pView->GeolocationToScreen(mapsCoord, x, y);
+       here_error_e error = pView->GeolocationToScreen(hView, mapsCoord, x, y);
        delete pView;
 
        return error;
 }
 
-int HerePluginGetMinZoomLevel(int *nMinZoomLevel)
+int HerePluginGetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel)
 {
-       return HereView::GetMinZoomLevel(nMinZoomLevel);
+       if (!hView)
+               return HERE_ERROR_INVALID_PARAMETER;
+
+       return HereView::GetMinZoomLevel(hView, nMinZoomLevel);
 }
 
-int HerePluginGetMaxZoomLevel(int *nMaxZoomLevel)
+int HerePluginGetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel)
 {
-       return HereView::GetMaxZoomLevel(nMaxZoomLevel);
+       if (!hView)
+               return HERE_ERROR_INVALID_PARAMETER;
+
+       return HereView::GetMaxZoomLevel(hView, nMaxZoomLevel);
 }
 
-int HerePluginOnViewObject(const maps_view_object_h object,
-                          const maps_view_object_operation_e operation)
+int HerePluginOnViewObject(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation)
 {
-       return HereView::OnViewObject(object, operation);
+       if (!hView)
+               return HERE_ERROR_INVALID_PARAMETER;
+
+       return HereView::OnViewObject(hView, object, operation);
 }
index c6a83e6..fd516a7 100644 (file)
@@ -264,8 +264,7 @@ EXPORT_API int maps_plugin_get_place_details(const char* url,
 }
 
 EXPORT_API int maps_plugin_search_route(const maps_coordinates_h origin, const maps_coordinates_h destination,
-       maps_preference_h preference, maps_service_search_route_cb callback,
-       void* user_data, int* request_id)
+       maps_preference_h preference, maps_service_search_route_cb callback, void* user_data, int* request_id)
 {
        int ret = HerePluginSearchRoute(origin, destination, preference, callback, user_data, request_id);
 
@@ -295,24 +294,28 @@ EXPORT_API int maps_plugin_cancel_request(int request_id)
 }
 
 /* Mapping */
-EXPORT_API int maps_plugin_set_map_view(const maps_view_h view, maps_plugin_map_view_ready_cb pCbFunc)
+EXPORT_API int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
 {
-       int ret = HerePluginSetMapView(view, pCbFunc);
+       int ret = HerePluginCreateMapView(hView, pCbFunc);
 
        MAPS_LOGD("here_error_e = %d", ret);
 
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_render_map(const maps_coordinates_h coordinates,
-                                       const double zoom_factor,
-                                       const double rotation_angle,
-                                       maps_plugin_render_map_cb callback,
-                                       void* user_data,
-                                       int* request_id)
+EXPORT_API int maps_plugin_destroy_map_view(maps_view_h hView)
+{
+       int ret = HerePluginDestroyMapView(hView);
+
+       MAPS_LOGD("here_error_e = %d", ret);
+
+       return ConvertToMapsError(ret);
+}
 
+EXPORT_API int maps_plugin_render_map(maps_view_h hView, const maps_coordinates_h coordinates, const double zoom_factor,
+                                       const double rotation_angle, maps_plugin_render_map_cb callback, void* user_data, int* request_id)
 {
-       int ret = HerePluginRenderMap(coordinates, zoom_factor, rotation_angle,
+       int ret = HerePluginRenderMap(hView, coordinates, zoom_factor, rotation_angle,
                                        callback, user_data, request_id);
 
        if (ret != HERE_ERROR_NONE)
@@ -321,15 +324,10 @@ EXPORT_API int maps_plugin_render_map(const maps_coordinates_h coordinates,
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_render_map_area(const maps_area_h area,
-                                       const double zoom_factor,
-                                       const double rotation_angle,
-                                       maps_plugin_render_map_cb callback,
-                                       void* user_data,
-                                       int* request_id)
+EXPORT_API int maps_plugin_render_map_area(maps_view_h hView, const maps_area_h area, const double zoom_factor,
+                                       const double rotation_angle, maps_plugin_render_map_cb callback, void* user_data, int* request_id)
 {
-       int ret = HerePluginRenderMapArea(area, zoom_factor, rotation_angle,
-                                       callback, user_data, request_id);
+       int ret = HerePluginRenderMapArea(hView, area, zoom_factor, rotation_angle, callback, user_data, request_id);
 
        if (ret != HERE_ERROR_NONE)
                MAPS_LOGD("here_error_e = %d", ret);
@@ -337,13 +335,10 @@ EXPORT_API int maps_plugin_render_map_area(const maps_area_h area,
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_move_center(const int delta_x, const int delta_y,
-                                       maps_plugin_render_map_cb callback,
-                                       void* user_data,
-                                       int* request_id)
+EXPORT_API int maps_plugin_move_center(maps_view_h hView, const int delta_x, const int delta_y, maps_plugin_render_map_cb callback,
+                                       void* user_data, int* request_id)
 {
-       int ret = HerePluginMoveCenter(delta_x, delta_y,
-                                       callback, user_data, request_id);
+       int ret = HerePluginMoveCenter(hView, delta_x, delta_y, callback, user_data, request_id);
 
        if (ret != HERE_ERROR_NONE)
                MAPS_LOGD("here_error_e = %d", ret);
@@ -351,9 +346,9 @@ EXPORT_API int maps_plugin_move_center(const int delta_x, const int delta_y,
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_set_scalebar(bool enable)
+EXPORT_API int maps_plugin_set_scalebar(maps_view_h hView, bool enable)
 {
-       int ret = HerePluginSetScalebar(enable);
+       int ret = HerePluginSetScalebar(hView, enable);
 
        if (ret != HERE_ERROR_NONE)
                MAPS_LOGD("here_error_e = %d", ret);
@@ -361,14 +356,13 @@ EXPORT_API int maps_plugin_set_scalebar(bool enable)
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_get_scalebar(bool *enabled)
+EXPORT_API int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled)
 {
-       int ret = HerePluginGetScalebar(enabled);
+       int ret = HerePluginGetScalebar(hView, enabled);
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_draw_map(Evas* canvas, const int x, const int y,
-                                   const int width, const int height)
+EXPORT_API int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, const int x, const int y, const int width, const int height)
 {
        int ret = HerePluginDrawMap(canvas, x, y, width, height);
 
@@ -378,42 +372,39 @@ EXPORT_API int maps_plugin_draw_map(Evas* canvas, const int x, const int y,
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_get_center(maps_coordinates_h *center)
+EXPORT_API int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *center)
 {
-       int ret = HerePluginGetCenter(center);
+       int ret = HerePluginGetCenter(hView, center);
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_screen_to_geography(const int x, const int y,
-                                              maps_coordinates_h *mapsCoord)
+EXPORT_API int maps_plugin_screen_to_geography(maps_view_h hView, const int x, const int y, maps_coordinates_h *mapsCoord)
 {
-       int ret = HerePluginScreenToGeography(x, y, mapsCoord);
+       int ret = HerePluginScreenToGeography(hView, x, y, mapsCoord);
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_geography_to_screen(const maps_coordinates_h mapsCoord,
-                                              int* x, int* y)
+EXPORT_API int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h mapsCoord, int* x, int* y)
 {
-       int ret = HerePluginGeographyToScreen(mapsCoord, x, y);
+       int ret = HerePluginGeographyToScreen(hView, mapsCoord, x, y);
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_get_min_zoom_level(int *min_zoom_level)
+EXPORT_API int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level)
 {
-       int ret = HerePluginGetMinZoomLevel(min_zoom_level);
+       int ret = HerePluginGetMinZoomLevel(hView, min_zoom_level);
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_get_max_zoom_level(int *max_zoom_level)
+EXPORT_API int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level)
 {
-       int ret = HerePluginGetMaxZoomLevel(max_zoom_level);
+       int ret = HerePluginGetMaxZoomLevel(hView, max_zoom_level);
        return ConvertToMapsError(ret);
 }
 
-EXPORT_API int maps_plugin_on_object(const maps_view_object_h object,
-                              const maps_view_object_operation_e operation)
+EXPORT_API int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation)
 {
-       int ret = HerePluginOnViewObject(object, operation);
+       int ret = HerePluginOnViewObject(hView, object, operation);
 
        if (ret != HERE_ERROR_NONE)
                MAPS_LOGD("here_error_e = %d", ret);
index 0c9aa0d..5b243e5 100644 (file)
@@ -24,8 +24,6 @@ static const char SIG_LOADED[] = "loaded";
 
 HERE_PLUGIN_BEGIN_NAMESPACE
 
-GLData *HereView::m_pImpl = NULL;
-
 HereView::HereView(void *pCbFunc, void *pUserData, int nReqId)
 {
        m_pCbFunc = pCbFunc;
@@ -37,18 +35,14 @@ HereView::~HereView()
 {
 }
 
-GLData* HereView::GetImplHandler()
-{
-       return m_pImpl;
-}
-
 here_error_e HereView::Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
 {
+       GLData *m_pImpl = NULL;
+
        if (!hView)
                return HERE_ERROR_INVALID_PARAMETER;
 
-       if (m_pImpl)
-               return HERE_ERROR_INVALID_OPERATION;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
 
        if (!m_pImpl)
        {
@@ -57,9 +51,12 @@ here_error_e HereView::Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCb
                if (!m_pImpl)
                        return HERE_ERROR_INVALID_PARAMETER;
 
-               m_pImpl->idler = ecore_idler_add(__idlerCb, (void*)m_pImpl);
+               maps_view_set_maps_plugin_view_handle(hView, (void *)m_pImpl);
+
+               m_pImpl->idler = ecore_idler_add(__idlerCb, (void*)hView);
                m_pImpl->readyCb = NULL;
-       }
+       } else
+               return HERE_ERROR_INVALID_OPERATION;
 
        here_error_e error = HERE_ERROR_NONE;
        int error2 = MAPS_ERROR_NONE;
@@ -71,15 +68,13 @@ here_error_e HereView::Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCb
                error2 = maps_view_get_screen_location(hView, &m_pImpl->x, &m_pImpl->y, &m_pImpl->w, &m_pImpl->h);
                if (error2 != MAPS_ERROR_NONE) break;
 
-               m_pImpl->hView = hView;
-
                error = InitOpenGL(m_pImpl);
                if (error != HERE_ERROR_NONE) break;
 
-               error = InitOpenGLSurface(m_pImpl);
+               error = InitOpenGLSurface(hView);
                if (error != HERE_ERROR_NONE) break;
 
-               error = InitMap(m_pImpl, pCbFunc);
+               error = InitMap(hView, m_pImpl, pCbFunc);
        } while(0);
 
        if (error == HERE_ERROR_NONE && error2 != MAPS_ERROR_NONE)
@@ -130,65 +125,73 @@ here_error_e HereView::InitOpenGL(GLData *gld)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::InitOpenGLSurface(GLData *gld)
+here_error_e HereView::InitOpenGLSurface(maps_view_h hView)
 {
-       if (!gld || !gld->gl || !gld->cfg || !gld->img || !gld->ctx)
+       if (!hView)
                return HERE_ERROR_INVALID_PARAMETER;
 
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
+       if (!m_pImpl || !m_pImpl->gl || !m_pImpl->cfg || !m_pImpl->img || !m_pImpl->ctx)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       evas_object_image_pixels_get_callback_set(gld->img, NULL, NULL);
+       evas_object_image_pixels_get_callback_set(m_pImpl->img, NULL, NULL);
 
-       if (gld->sfc)
+       if (m_pImpl->sfc)
        {
-               evas_object_image_native_surface_set(gld->img, NULL);
-               evas_gl_surface_destroy(gld->gl, gld->sfc);
+               evas_object_image_native_surface_set(m_pImpl->img, NULL);
+               evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
        }
 
        m_pImpl->w = MAX(m_pImpl->w, 1);
        m_pImpl->h = MAX(m_pImpl->h, 1);
 
-       evas_object_image_size_set(gld->img, gld->w, gld->h);
+       evas_object_image_size_set(m_pImpl->img, m_pImpl->w, m_pImpl->h);
 
        Evas_Native_Surface ns;
-       gld->sfc = evas_gl_surface_create(gld->gl, gld->cfg, gld->w, gld->h);
-       if (!gld->sfc)
+       m_pImpl->sfc = evas_gl_surface_create(m_pImpl->gl, m_pImpl->cfg, m_pImpl->w, m_pImpl->h);
+       if (!m_pImpl->sfc)
        {
                MAPS_LOGE("evas_gl_surface_create() failed");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       if (!evas_gl_native_surface_get(gld->gl, gld->sfc, &ns))
+       if (!evas_gl_native_surface_get(m_pImpl->gl, m_pImpl->sfc, &ns))
        {
-               evas_gl_make_current(gld->gl, NULL, NULL);
-               evas_gl_surface_destroy(gld->gl, gld->sfc);
-               gld->sfc = NULL;
+               evas_gl_make_current(m_pImpl->gl, NULL, NULL);
+               evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
+               m_pImpl->sfc = NULL;
                MAPS_LOGE("evas_gl_native_surface_get() faile");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       evas_object_image_native_surface_set(gld->img, &ns);
+       evas_object_image_native_surface_set(m_pImpl->img, &ns);
 
-       evas_object_image_pixels_get_callback_set(gld->img, __pixelGetCb, this);
+       evas_object_image_pixels_get_callback_set(m_pImpl->img, __pixelGetCb, hView);
 
-       gld->isInitialized = true;
+       m_pImpl->isInitialized = true;
        //MAPS_LOGD("initializing is Done!!!");
 
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::InitMap(GLData *gld, maps_plugin_map_view_ready_cb pCbFunc)
+here_error_e HereView::InitMap(maps_view_h hView, GLData *gld, maps_plugin_map_view_ready_cb pCbFunc)
 {
-       if (!gld)
+       if (!hView || !gld)
                return HERE_ERROR_INVALID_PARAMETER;
 
        gld->map = new (std::nothrow) GeoTiledMap();
 
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!gld->map)
                return HERE_ERROR_OUT_OF_MEMORY;
 
        gld->readyCb = pCbFunc;
 
-       gld->map->SetReadyMapSignal((GeoTiledMap::ReadyMapSignalFunctor)__readyCb);
+       gld->map->SetReadyMapSignal((GeoTiledMap::ReadyMapSignalFunctor)__readyCb, (void *)hView);
 
        gld->map->SetEvasGlApi(gld->api);
 
@@ -203,8 +206,17 @@ here_error_e HereView::InitMap(GLData *gld, maps_plugin_map_view_ready_cb pCbFun
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::Close()
+here_error_e HereView::Close(maps_view_h hView)
 {
+       if (!hView)
+               return HERE_ERROR_INVALID_PARAMETER;
+
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
+       if (!m_pImpl)
+               return HERE_ERROR_INVALID_OPERATION;
+
        if (m_pImpl)
        {
                m_pImpl->isInitialized = false;
@@ -268,14 +280,28 @@ here_error_e HereView::Close()
        return HERE_ERROR_NONE;
 }
 
-void HereView::__readyCb()
+void HereView::__readyCb(void *data)
 {
+       if (!data)
+               return;
+
+       maps_view_h hView = (maps_view_h)data;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (m_pImpl->readyCb)
-               m_pImpl->readyCb(m_pImpl->hView);
+               m_pImpl->readyCb(hView);
 }
 
 void HereView::__pixelGetCb(void *data, Evas_Object *obj)
 {
+       if (!data)
+               return;
+
+       maps_view_h hView = (maps_view_h)data;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->map) return;
        if (!m_pImpl->gl || !m_pImpl->sfc || !m_pImpl->ctx) return;
 
@@ -289,17 +315,22 @@ void HereView::__renderingCb(void *data)
        evas_object_image_pixels_dirty_set((Evas_Object*)data, EINA_TRUE);
 }
 
-void HereView::__setMapType()
+void HereView::__setMapType(maps_view_h hView)
 {
+       if (!hView)
+               return;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        /* When the theme is changed, clear cache */
        maps_view_type_e map_type;
-       maps_view_get_type(m_pImpl->hView, &map_type);
+       maps_view_get_type(hView, &map_type);
 
        bool buildings_enabled = false;
-       maps_view_get_buildings_enabled(m_pImpl->hView, &buildings_enabled);
+       maps_view_get_buildings_enabled(hView, &buildings_enabled);
 
        bool traffic_enabled = false;
-       maps_view_get_traffic_enabled(m_pImpl->hView, &traffic_enabled);
+       maps_view_get_traffic_enabled(hView, &traffic_enabled);
 
        bool public_transit_enabled = false;
 
@@ -317,8 +348,12 @@ void HereView::__setMapType()
        }
 }
 
-here_error_e HereView::RenderMap(const maps_coordinates_h mapsCoord, double dZoom, double dAngle)
+here_error_e HereView::RenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
 
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->api)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
@@ -327,11 +362,11 @@ here_error_e HereView::RenderMap(const maps_coordinates_h mapsCoord, double dZoo
                return HERE_ERROR_INVALID_PARAMETER;
 
        /* set map type */
-       __setMapType();
+       __setMapType(hView);
 
        /* resize window */
        int x, y, w, h;
-       maps_view_get_screen_location(m_pImpl->hView, &x, &y, &w, &h);
+       maps_view_get_screen_location(hView, &x, &y, &w, &h);
        m_pImpl->w = MAX(m_pImpl->w, 1);
        m_pImpl->h = MAX(m_pImpl->h, 1);
 
@@ -344,7 +379,7 @@ here_error_e HereView::RenderMap(const maps_coordinates_h mapsCoord, double dZoo
 
                m_pImpl->api->glViewport(0, 0, m_pImpl->w, m_pImpl->h);
                m_pImpl->map->SetMapSize(Dimension(m_pImpl->w,m_pImpl->h));
-               InitOpenGLSurface(m_pImpl);
+               InitOpenGLSurface(hView);
        }
 
        /* callback */
@@ -377,8 +412,13 @@ here_error_e HereView::RenderMap(const maps_coordinates_h mapsCoord, double dZoo
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::RenderMapByArea(const maps_area_h hArea, double dZoom, double dAngle)
+here_error_e HereView::RenderMapByArea(maps_view_h hView, const maps_area_h hArea, double dZoom, double dAngle)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -388,8 +428,13 @@ here_error_e HereView::RenderMapByArea(const maps_area_h hArea, double dZoom, do
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::MoveCenter(int delta_x, int delta_y)
+here_error_e HereView::MoveCenter(maps_view_h hView, int delta_x, int delta_y)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -401,8 +446,13 @@ here_error_e HereView::MoveCenter(int delta_x, int delta_y)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::SetScalebar(bool enable)
+here_error_e HereView::SetScalebar(maps_view_h hView, bool enable)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -411,8 +461,13 @@ here_error_e HereView::SetScalebar(bool enable)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::GetScalebar(bool *enabled)
+here_error_e HereView::GetScalebar(maps_view_h hView, bool *enabled)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !enabled)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -420,8 +475,13 @@ here_error_e HereView::GetScalebar(bool *enabled)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::DrawMap(Evas* pCanvas, int x, int y, int nWidth, int nHeight)
+here_error_e HereView::DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int nWidth, int nHeight)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -469,8 +529,13 @@ here_error_e HereView::DrawMap(Evas* pCanvas, int x, int y, int nWidth, int nHei
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::GetCenter(maps_coordinates_h *center)
+here_error_e HereView::GetCenter(maps_view_h hView, maps_coordinates_h *center)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!center)
                return HERE_ERROR_INVALID_PARAMETER;
 
@@ -489,8 +554,13 @@ here_error_e HereView::GetCenter(maps_coordinates_h *center)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::ScreenToGeolocation(int x, int y, maps_coordinates_h *mapsCoord)
+here_error_e HereView::ScreenToGeolocation(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -528,8 +598,13 @@ here_error_e HereView::ScreenToGeolocation(int x, int y, maps_coordinates_h *map
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::GeolocationToScreen(const maps_coordinates_h mapsCoord, int *x, int *y)
+here_error_e HereView::GeolocationToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -548,8 +623,13 @@ here_error_e HereView::GeolocationToScreen(const maps_coordinates_h mapsCoord, i
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::GetMinZoomLevel(int *nMinZoomLevel)
+here_error_e HereView::GetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -561,8 +641,13 @@ here_error_e HereView::GetMinZoomLevel(int *nMinZoomLevel)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::GetMaxZoomLevel(int *nMaxZoomLevel)
+here_error_e HereView::GetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -574,8 +659,13 @@ here_error_e HereView::GetMaxZoomLevel(int *nMaxZoomLevel)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::OnViewObject(const maps_view_object_h object, maps_view_object_operation_e operation)
+here_error_e HereView::OnViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation)
 {
+       if (!hView)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
@@ -583,7 +673,7 @@ here_error_e HereView::OnViewObject(const maps_view_object_h object, maps_view_o
                return HERE_ERROR_INVALID_PARAMETER;
 
        if (m_pImpl->map->GetRootPixmap())
-               __processViewObject(object, operation);
+               __processViewObject(hView, object, operation);
        else
                m_pImpl->pendingObjects.push_back(std::make_pair(object, operation));
 
@@ -592,25 +682,33 @@ here_error_e HereView::OnViewObject(const maps_view_object_h object, maps_view_o
 
 Eina_Bool HereView::__idlerCb(void *data)
 {
-       GLData *pImpl = (GLData*)data;
+       if (!data) return false;
+       maps_view_h hView = (maps_view_h)data;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
 
-       if (!pImpl || !pImpl->map || !pImpl->map->GetRootPixmap()) return true;
+       if (!m_pImpl || !m_pImpl->map || !m_pImpl->map->GetRootPixmap()) return true;
 
-       while (pImpl->pendingObjects.size())
+       while (m_pImpl->pendingObjects.size())
        {
-               PendingObject pending = pImpl->pendingObjects.front();
-               pImpl->pendingObjects.pop_front();
+               PendingObject pending = m_pImpl->pendingObjects.front();
+               m_pImpl->pendingObjects.pop_front();
                maps_view_object_h object = pending.first;
                maps_view_object_operation_e operation = pending.second;
 
-               __processViewObject(object, operation);
+               __processViewObject(hView, object, operation);
        }
 
        return true;
 }
 
-void HereView::__processViewObject(const maps_view_object_h object, maps_view_object_operation_e operation)
+void HereView::__processViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation)
 {
+       if (!hView)
+               return;
+       GLData *m_pImpl = NULL;
+       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
        maps_view_object_type_e type;
        maps_view_object_get_type(object, &type);
 
@@ -627,8 +725,8 @@ void HereView::__processViewObject(const maps_view_object_h object, maps_view_ob
 
        switch(operation)
        {
-       case MAPS_VIEW_OBJECT_ADD:                      m_pImpl->visualObjects.add(object); break;
-       case MAPS_VIEW_OBJECT_SET_VISIBLE:      m_pImpl->visualObjects.setVisible(object); break;
+       case MAPS_VIEW_OBJECT_ADD:                              m_pImpl->visualObjects.add(object); break;
+       case MAPS_VIEW_OBJECT_SET_VISIBLE:              m_pImpl->visualObjects.setVisible(object); break;
        case MAPS_VIEW_OBJECT_CHANGE:                   m_pImpl->visualObjects.update(object); break;
        case MAPS_VIEW_OBJECT_REMOVE:                   m_pImpl->visualObjects.remove(object); break;
        default:                        break;