2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
23 #include "here_manager.h"
24 #include "here_base.h"
25 #include "here_view_objects.h"
28 #include <maps_service.h>
29 #include <maps_view.h>
32 #include <maps/GeoTiledMap.h>
34 #include <Ecore_Evas.h>
35 #include <graphic/Grp_Util.h>
36 #include <maps/GeoMapObjectMarker.h>
37 #include <maps/GeoMapObjectPolygon.h>
38 #include <maps/GeoMapObjectPolyline.h>
40 HERE_PLUGIN_BEGIN_NAMESPACE
42 using namespace HERE_MAPS_NAMESPACE_PREFIX;
45 typedef struct _GLData
47 Here::Maps::GeoTiledMap *map;
59 double lat, lng, zoom, angle;
63 // to remove // UpdatedObjects updatedObjects;
64 HereViewObjects visualObjects;
65 PendingObjects pendingObjects;
69 maps_plugin_map_view_ready_cb readyCb;
76 HereView(void *pCbFunc, void *pUserData, int nReqId);
79 here_error_e Init(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
80 static here_error_e Close();
81 here_error_e RenderMap(const maps_coordinates_h mapsCoord, double dZoom, double dAngle);
82 here_error_e RenderMapByArea(const maps_area_h hArea, double dZoom, double dAngle);
83 static here_error_e DrawMap(Evas* pCanvas, int x, int y, int nWidth, int nHeight);
84 here_error_e MoveCenter(int delta_x, int delta_y);
85 here_error_e SetScalebar(bool enable);
86 here_error_e GetScalebar(bool *enabled);
87 here_error_e GetCenter(maps_coordinates_h *center);
88 here_error_e ScreenToGeolocation(int x, int y, maps_coordinates_h *mapsCoord);
89 here_error_e GeolocationToScreen(const maps_coordinates_h mapsCoord, int *x, int *y);
91 static here_error_e GetMinZoomLevel(int *nMinZoomLevel);
92 static here_error_e GetMaxZoomLevel(int *nMaxZoomLevel);
93 static here_error_e OnViewObject(const maps_view_object_h object, maps_view_object_operation_e operation);
95 static void RenderingCb(void *data);
96 static bool foreachObject(int index, int total, maps_view_object_h object, void *user_data);
97 static GLData* GetImplHandler();
101 here_error_e InitOpenGL(GLData *gld);
102 here_error_e InitOpenGLSurface(GLData *gld);
103 here_error_e InitMap(GLData *gld, maps_plugin_map_view_ready_cb pCbFunc);
104 static void __readyCb();
105 static Eina_Bool __idlerCb(void *data);
106 static void __renderingCb(void *data);
107 static void __pixelGetCb(void *data, Evas_Object *obj);
108 static void __processViewObject(const maps_view_object_h object, maps_view_object_operation_e operation);
111 static GLData *m_pImpl;
115 HERE_PLUGIN_END_NAMESPACE