Adds geocode support 11/77711/1
authorKevin Kreiser <kevinkreiser@gmail.com>
Mon, 20 Jun 2016 20:36:36 +0000 (16:36 -0400)
committerBaldur Gudbjornsson <baldur@mapzen.com>
Thu, 30 Jun 2016 13:47:01 +0000 (09:47 -0400)
Change-Id: Id6a89248698d5aabbc02576d51d75fd6183f7676

14 files changed:
CMakeLists.txt
inc/mapzen_plugin.h [deleted file]
inc/mapzen_plugin_internal.h [deleted file]
include/mapzen_plugin.h [new file with mode: 0644]
include/mapzen_plugin_internal.h [new file with mode: 0644]
packaging/maps-plugin-mapzen.spec
src/mapzen/mapzen_api.c
src/mapzen/mapzen_geocode.c
src/mapzen/mapzen_jsonparser.cpp
src/mapzen/mapzen_jsonparser.hpp
src/mapzen/mapzen_queue.c
src/mapzen/mapzen_revgeocode.c
src/mapzen/mapzen_types.h
src/mapzen_plugin.c

index a906efc543c2f37758159f990163fd4f63405ede..2726d0fd469d8cdbc34efec8de43b4b2566894b0 100644 (file)
@@ -1,26 +1,12 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(pkg_name "maps-plugin-mapzen")
-PROJECT(${pkg_name} C CXX)
+SET(fw_name "maps-plugin-mapzen")
+PROJECT(${fw_name} C CXX)
 
 SET(CMAKE_INSTALL_PREFIX /usr)
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(LIBDIR ${LIBDIR})
 
 # Dependencies
-SET(dependents 
-       glib-2.0
-       gmodule-2.0
-       libxml-2.0
-       dlog
-       capi-maps-service
-       capi-network-connection
-       capi-appfw-app-manager
-       capi-appfw-application
-       evas
-       ecore-evas
-       elementary
-       vconf
-       )
+SET(dependents "glib-2.0 gmodule-2.0 dlog libcurl capi-network-connection capi-maps-service")
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED ${dependents})
@@ -36,8 +22,11 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -fPIC -Wall -Werror")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIC -std=c++11 -fvisibility=hidden")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpie ${EXTRA_CFLAGS} -Wall -g -fPIC -std=c++11 -fvisibility=hidden")
+
+IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
 
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")
@@ -45,15 +34,30 @@ ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
 
-# Includes
+
+# Include files
+# Maps Service Includes
 SET(INC_DIR
-       inc
+       include
+)
+
+# Maps Service Implementation
+SET(INTERNAL_INC_DIR
+       src
+)
+
+# Mapzen Engine Implementation
+SET(ENGINE_INC_DIR
        src/mapzen
-       external/rapidjson/include      
+)
+
+# External dependencies
+SET(EXTERNAL_INC_DIR
+       external/rapidjson/include
 )
 
 INCLUDE_DIRECTORIES(
-       ${INC_DIR}
+${INC_DIR} ${INTERNAL_INC_DIR} ${ENGINE_INC_DIR} ${EXTERNAL_INC_DIR}
 )
 
 #This file must be corrected
@@ -62,25 +66,58 @@ INCLUDE_DIRECTORIES(
 SET(SRCS
        # Maps API
        src/mapzen_plugin.c
+
+       # Mapzen Engine
        src/mapzen/mapzen_api.c
        src/mapzen/mapzen_geocode.c
-       src/mapzen/mapzen_jsonparser.cpp
-       src/mapzen/mapzen_place.c
-       src/mapzen/mapzen_queue.c
-       src/mapzen/mapzen_restcurl.c
        src/mapzen/mapzen_revgeocode.c
        src/mapzen/mapzen_route.cpp
+       src/mapzen/mapzen_place.c
+       src/mapzen/mapzen_restcurl.c
+       src/mapzen/mapzen_jsonparser.cpp
+       src/mapzen/mapzen_queue.c
        src/mapzen/mapzen_util.c
 )
 
-ADD_LIBRARY(${pkg_name} SHARED ${SRCS})
+ADD_LIBRARY(${fw_name} SHARED ${SRCS})
 
-SET_TARGET_PROPERTIES(${pkg_name}
+SET_TARGET_PROPERTIES(${fw_name}
        PROPERTIES
     VERSION ${FULLVER}
     SOVERSION ${MAJORVER}
     CLEAN_DIRECT_OUTPUT 1
 )
 
+TARGET_LINK_LIBRARIES(${fw_name} ${pkgs_LDFLAGS})
+
+SET(PC_NAME ${fw_name})
+SET(PC_DESCRIPTION "Tizen mapzen plugin Library")
+SET(PC_LDFLAGS -l${fw_name})
+SET(PC_INCLUDE /usr/include/maps)
+
+CONFIGURE_FILE(
+       ${fw_name}.pc.in
+       ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+       @ONLY
+)
+
 # Install
-INSTALL(TARGETS ${pkg_name} DESTINATION ${LIBDIR}/maps/plugins)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
+INSTALL(TARGETS ${fw_name} DESTINATION lib/maps/plugins)
+
+#INCLUDE(FindPkgConfig)
+#pkg_check_modules(lib_pkgs REQUIRED
+#              capi-maps-service
+#)
+
+SET(LIB_APP_ASSIST capi-maps-service)
+INSTALL(
+       DIRECTORY ${INC_DIR}/ DESTINATION include/mapzen-plugin
+       FILES_MATCHING
+       PATTERN "*_internal.h" EXCLUDE
+       PATTERN "${INC_DIR}/mapzen_*.h"
+)
+
+# Test Suite
+#IF("${BINTYPE}" STREQUAL "eng")
+#ENDIF("${BINTYPE}" STREQUAL "eng")
diff --git a/inc/mapzen_plugin.h b/inc/mapzen_plugin.h
deleted file mode 100644 (file)
index acfb4d3..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _MAPZEN_PLUGIN_H_
-#define _MAPZEN_PLUGIN_H_
-
-#include <maps_plugin.h>
-#include <glib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct callback_geocode {
-       maps_service_geocode_cb callback;
-       void *data;
-       int reqID;
-} callback_info_geocode;
-
-typedef struct callback_reverse_geocode {
-       maps_service_reverse_geocode_cb callback;
-       void *data;
-       int reqID;
-} callback_info_reverse_geocode;
-
-typedef struct callback_route {
-       maps_service_search_route_cb callback;
-       void *data;
-       int reqID;
-} callback_info_route;
-
-typedef struct callback_place {
-       maps_service_search_place_cb callback;
-       void *data;
-       int reqID;
-} callback_info_place;
-
-int maps_plugin_init(maps_plugin_h *plugin);
-
-int maps_plugin_shutdown(maps_plugin_h plugin);
-
-int maps_plugin_is_service_supported(maps_service_e service, bool *supported);
-
-int maps_plugin_is_data_supported(maps_service_data_e data, bool *supported);
-
-int maps_plugin_get_info(maps_plugin_info_h *info);
-
-int maps_plugin_set_provider_key(const char *provider_key);
-
-int maps_plugin_get_provider_key(char **provider_key);
-
-int maps_plugin_set_preference(maps_item_hashtable_h preference);
-
-int maps_plugin_get_preference(maps_item_hashtable_h *preference);
-
-/* Geocode */
-int maps_plugin_geocode(const char *address, const maps_preference_h preference, maps_service_geocode_cb callback, void *user_data, int *request_id);
-
-/* Geocode inside area */
-int maps_plugin_geocode_inside_area(const char *address, const maps_area_h bounds, const maps_preference_h preference, maps_service_geocode_cb callback, void *user_data, int *request_id);
-
-/* Geocode by structured address */
-int maps_plugin_geocode_by_structured_address(const maps_address_h address, const maps_preference_h preference, maps_service_geocode_cb callback, void *user_data, int *request_id);
-
-/* Rev Geocode */
-int maps_plugin_reverse_geocode(double latitude, double longitude, const maps_preference_h preference, maps_service_reverse_geocode_cb callback, void *user_data, int *request_id);
-
-/* Route search */
-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);
-
-/* Route search waypoints */
-int maps_plugin_search_route_waypoints(const maps_coordinates_h *waypoint_list, int waypoint_num, maps_preference_h preference, maps_service_search_route_cb callback, void *user_data, int *request_id);
-
-/* Place search */
-int maps_plugin_search_place(const maps_coordinates_h position, int distance, const maps_place_filter_h filter, maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id);
-
-/* Place search by area */
-int maps_plugin_search_place_by_area(const maps_area_h boundary, const maps_place_filter_h filter, maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id);
-
-/* Place search by address */
-int maps_plugin_search_place_by_address(const char *address, const maps_area_h boundary, const maps_place_filter_h filter, maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id);
-
-/* Cancel Request */
-int maps_plugin_cancel_request(int request_id);
-
-#ifdef __cplusplus
-}
-#endif
-#endif                         /* _MAPZEN_PLUGIN_H_ */
diff --git a/inc/mapzen_plugin_internal.h b/inc/mapzen_plugin_internal.h
deleted file mode 100644 (file)
index 517bdc4..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __MAPZEN_PLUGIN_INTERNAL_H__
-#define __MAPZEN_PLUGIN_INTERNAL_H__
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "MAPZEN_PLUGIN"
-
-/*
- * Internal Macros
- */
-#define MAPS_LOGD(fmt, args...)  LOGD(fmt, ##args)
-#define MAPS_LOGW(fmt, args...)  LOGW(fmt, ##args)
-#define MAPS_LOGI(fmt, args...)  LOGI(fmt, ##args)
-#define MAPS_LOGE(fmt, args...)  LOGE(fmt, ##args)
-#define MAPS_SECLOG(fmt, args...)  SECURE_LOGD(fmt, ##args)
-
-#define MAPS_CHECK_CONDITION(condition, error, msg)    \
-       do { \
-               if (condition) { \
-               } else { \
-                       MAPS_LOGE("%s(0x%08x)", msg, error); \
-                       return error; \
-               } \
-       } while (0)
-
-#define MAPS_NULL_ARG_CHECK_RETURN_FALSE(arg)\
-       do { \
-               if (arg != NULL) { \
-               } else  { \
-                       MAPS_LOGE("MAPS_ERROR_INVALID_PARAMETER");  \
-                       return false; };        \
-       } while (0)
-
-#define MAPS_NULL_ARG_CHECK(arg)       \
-       MAPS_CHECK_CONDITION(arg != NULL, MAPS_ERROR_INVALID_PARAMETER, "MAPS_ERROR_INVALID_PARAMETER")
-
-#define MAPS_PRINT_ERROR_CODE_RETURN(code) \
-       do { \
-               MAPS_LOGE("%s(0x%08x)", #code, code); \
-               return code;    \
-       } while (0)
-
-#endif /* __MAPZEN_PLUGIN_INTERNAL_H__ */
diff --git a/include/mapzen_plugin.h b/include/mapzen_plugin.h
new file mode 100644 (file)
index 0000000..df24cfd
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _MAPZEN_PLUGIN_H_
+#define _MAPZEN_PLUGIN_H_
+
+#include <maps_plugin.h>
+#include <glib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct callback_geocode {
+       maps_service_geocode_cb callback;
+       void *data;
+       int reqID;
+} callback_info_geocode;
+
+typedef struct callback_reverse_geocode {
+       maps_service_reverse_geocode_cb callback;
+       void *data;
+       int reqID;
+} callback_info_reverse_geocode;
+
+typedef struct callback_route {
+       maps_service_search_route_cb callback;
+       void *data;
+       int reqID;
+} callback_info_route;
+
+typedef struct callback_place {
+       maps_service_search_place_cb callback;
+       void *data;
+       int reqID;
+} callback_info_place;
+
+
+/* TODO: IMPLEMENT THESE FOR REAL */
+
+int maps_plugin_multi_reverse_geocode(const maps_coordinates_list_h geocode_list,
+       const maps_preference_h preference, maps_service_multi_reverse_geocode_cb callback,
+       void *user_data, int *request_id);
+
+int maps_plugin_search_place_list(const maps_area_h boundary, const maps_place_filter_h filter,
+       maps_preference_h preference, maps_service_search_place_list_cb callback, void* user_data, int* request_id);
+
+int maps_plugin_get_place_details(const char* url,
+       maps_service_get_place_details_cb callback, void* user_data, int* request_id);
+
+int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
+
+int maps_plugin_destroy_map_view(maps_view_h hView);
+
+int maps_plugin_render_map(maps_view_h hView,
+       const maps_coordinates_h coordinates, double zoom_factor, double rotation_angle);
+
+int maps_plugin_move_center(maps_view_h hView, int delta_x, int delta_y);
+
+int maps_plugin_set_scalebar(maps_view_h hView, bool enable);
+
+int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled);
+
+int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, int x, int y, int w, int h);
+
+int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
+
+int maps_plugin_screen_to_geography(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord);
+
+int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h mapsCoord, int* x, int* y);
+
+int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level);
+
+int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level);
+
+int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *center);
+
+/* ABOVE METHODS ARE THERE BUT RETURN  MAPS_ERROR_NOT_SUPPORTED */
+
+
+int maps_plugin_init_module(maps_plugin_h *plugin, const char *module);
+
+int maps_plugin_init(maps_plugin_h *plugin);
+
+int maps_plugin_shutdown(maps_plugin_h plugin);
+
+int maps_plugin_is_service_supported(maps_service_e service, bool *supported);
+
+int maps_plugin_is_data_supported(maps_service_data_e data, bool *supported);
+
+int maps_plugin_get_info(maps_plugin_info_h *info);
+
+int maps_plugin_set_provider_key(const char *provider_key);
+
+int maps_plugin_get_provider_key(char **provider_key);
+
+int maps_plugin_set_preference(maps_item_hashtable_h preference);
+
+int maps_plugin_get_preference(maps_item_hashtable_h *preference);
+
+/* Geocode */
+int maps_plugin_geocode(const char *address, const maps_preference_h preference, maps_service_geocode_cb callback, void *user_data, int *request_id);
+
+/* Geocode inside area */
+int maps_plugin_geocode_inside_area(const char *address, const maps_area_h bounds, const maps_preference_h preference, maps_service_geocode_cb callback, void *user_data, int *request_id);
+
+/* Geocode by structured address */
+int maps_plugin_geocode_by_structured_address(const maps_address_h address, const maps_preference_h preference, maps_service_geocode_cb callback, void *user_data, int *request_id);
+
+/* Rev Geocode */
+int maps_plugin_reverse_geocode(double latitude, double longitude, const maps_preference_h preference, maps_service_reverse_geocode_cb callback, void *user_data, int *request_id);
+
+/* Route search */
+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);
+
+/* Route search waypoints */
+int maps_plugin_search_route_waypoints(const maps_coordinates_h *waypoint_list, int waypoint_num, maps_preference_h preference, maps_service_search_route_cb callback, void *user_data, int *request_id);
+
+/* Place search */
+int maps_plugin_search_place(const maps_coordinates_h position, int distance, const maps_place_filter_h filter, maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id);
+
+/* Place search by area */
+int maps_plugin_search_place_by_area(const maps_area_h boundary, const maps_place_filter_h filter, maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id);
+
+/* Place search by address */
+int maps_plugin_search_place_by_address(const char *address, const maps_area_h boundary, const maps_place_filter_h filter, maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id);
+
+/* Cancel Request */
+int maps_plugin_cancel_request(int request_id);
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* _MAPZEN_PLUGIN_H_ */
diff --git a/include/mapzen_plugin_internal.h b/include/mapzen_plugin_internal.h
new file mode 100644 (file)
index 0000000..517bdc4
--- /dev/null
@@ -0,0 +1,61 @@
+/* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __MAPZEN_PLUGIN_INTERNAL_H__
+#define __MAPZEN_PLUGIN_INTERNAL_H__
+
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "MAPZEN_PLUGIN"
+
+/*
+ * Internal Macros
+ */
+#define MAPS_LOGD(fmt, args...)  LOGD(fmt, ##args)
+#define MAPS_LOGW(fmt, args...)  LOGW(fmt, ##args)
+#define MAPS_LOGI(fmt, args...)  LOGI(fmt, ##args)
+#define MAPS_LOGE(fmt, args...)  LOGE(fmt, ##args)
+#define MAPS_SECLOG(fmt, args...)  SECURE_LOGD(fmt, ##args)
+
+#define MAPS_CHECK_CONDITION(condition, error, msg)    \
+       do { \
+               if (condition) { \
+               } else { \
+                       MAPS_LOGE("%s(0x%08x)", msg, error); \
+                       return error; \
+               } \
+       } while (0)
+
+#define MAPS_NULL_ARG_CHECK_RETURN_FALSE(arg)\
+       do { \
+               if (arg != NULL) { \
+               } else  { \
+                       MAPS_LOGE("MAPS_ERROR_INVALID_PARAMETER");  \
+                       return false; };        \
+       } while (0)
+
+#define MAPS_NULL_ARG_CHECK(arg)       \
+       MAPS_CHECK_CONDITION(arg != NULL, MAPS_ERROR_INVALID_PARAMETER, "MAPS_ERROR_INVALID_PARAMETER")
+
+#define MAPS_PRINT_ERROR_CODE_RETURN(code) \
+       do { \
+               MAPS_LOGE("%s(0x%08x)", #code, code); \
+               return code;    \
+       } while (0)
+
+#endif /* __MAPZEN_PLUGIN_INTERNAL_H__ */
index f0e38f0a4c27ab5394480065b3b1a3e4a6b539cb..65900b93a84389227ac17f292a888aff5f5fd5c8 100644 (file)
@@ -8,21 +8,17 @@ Source0:    %{name}-%{version}.tar.gz
 Source1:    deps.tar.gz
 ExclusiveArch:  %ix86 x86_64 %arm aarch64
 
-BuildRequires: cmake
-BuildRequires: pkgconfig(libxml-2.0)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(libcurl)
-BuildRequires: pkgconfig(capi-maps-service)
-BuildRequires: capi-maps-service-plugin-devel
-BuildRequires: pkgconfig(capi-network-connection)
-BuildRequires: pkgconfig(capi-appfw-app-manager)
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(vconf)
-BuildRequires: boost-devel
-BuildRequires: capi-maps-service-devel
-BuildRequires: elementary-devel
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(gmodule-2.0)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires: pkgconfig(libcurl)
+BuildRequires:  pkgconfig(capi-network-connection)
+BuildRequires: pkgconfig(capi-maps-service)
+BuildRequires:  capi-maps-service-plugin-devel
+BuildRequires:  pkgconfig(json-glib-1.0)
+Requires(post):  /sbin/ldconfig
+Requires(postun):  /sbin/ldconfig
 
 #
 Requires(post): /sbin/ldconfig
@@ -79,4 +75,25 @@ cp LICENSE %{buildroot}/usr/share/license/%{name}
 %manifest maps-plugin-mapzen.manifest
 %defattr(-,root,root,-)
 %{_prefix}/lib/maps/plugins/libmaps-plugin-mapzen.so*
+%{_prefix}/lib/pkgconfig/maps-plugin-mapzen.pc
 /usr/share/license/maps-plugin-mapzen
+
+%package devel
+Summary:    Tizen Mapzen Maps Plug-in Library (Development)
+Group:      Framework/maps
+Requires:   %{name} = %{version}-%{release}
+
+%description devel
+This package provides Plugin APIs for Mapzen. (Development)
+
+%post devel
+/sbin/ldconfig
+
+%postun devel
+/sbin/ldconfig
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/mapzen-plugin/*.h
+%{_prefix}/lib/pkgconfig/maps-plugin-mapzen.pc
+%{_prefix}/lib/maps/plugins/libmaps-plugin-mapzen.so
index 4eb72b5f9414ab65bf57d92aeafaa6e37e90f0eb..26e709fc4f5fa903e19b73598211a9d7dda2c4d7 100644 (file)
 #include "mapzen_queue.h"
 #include "mapzen_debug.h"
 
-EXPORT_API int mapzen_init()
+int mapzen_init()
 {
        int ret = mapzen_init_queue();
 
        return ret;
 }
 
-EXPORT_API int mapzen_shutdown()
+int mapzen_shutdown()
 {
        int ret = mapzen_deinit_queue();
 
        return ret;
 }
 
-EXPORT_API int mapzen_geocode(mapzen_geocode_req_s *req_details, mapzen_geocode_cb callback, int request_id, void *user_data)
+int mapzen_geocode(mapzen_geocode_req_s *req_details, mapzen_geocode_cb callback, int request_id, void *user_data)
 {
        int ret = MAPZEN_ERROR_NONE;
        ret = start_geocode_service(req_details, callback, request_id, user_data);
@@ -43,14 +43,14 @@ EXPORT_API int mapzen_geocode(mapzen_geocode_req_s *req_details, mapzen_geocode_
        return ret;
 }
 
-EXPORT_API int mapzen_cancel_request(int request_id)
+int mapzen_cancel_request(int request_id)
 {
        int ret = remove_from_request_list(request_id);
 
        return ret;
 }
 
-EXPORT_API int mapzen_reverse_geocode(mapzen_revgeocode_req_s *req_details, mapzen_reverse_geocode_cb callback, int request_id, void *user_data)
+int mapzen_reverse_geocode(mapzen_revgeocode_req_s *req_details, mapzen_reverse_geocode_cb callback, int request_id, void *user_data)
 {
        int ret = MAPZEN_ERROR_NONE;
        ret = start_reversegeocode_service(req_details, callback, request_id, user_data);
@@ -58,7 +58,7 @@ EXPORT_API int mapzen_reverse_geocode(mapzen_revgeocode_req_s *req_details, mapz
        return ret;
 }
 
-EXPORT_API int mapzen_search_place(mapzen_search_req_s *req_details, mapzen_place_search_cb callback, int request_id, void *user_data)
+int mapzen_search_place(mapzen_search_req_s *req_details, mapzen_place_search_cb callback, int request_id, void *user_data)
 {
        int ret = MAPZEN_ERROR_NONE;
        ret = start_places_service(req_details, callback, request_id, user_data);
@@ -66,7 +66,7 @@ EXPORT_API int mapzen_search_place(mapzen_search_req_s *req_details, mapzen_plac
        return ret;
 }
 
-EXPORT_API int mapzen_start_route(mapzen_route_req_s *req_details, mapzen_route_cb callback, int request_id, void *user_data)
+int mapzen_start_route(mapzen_route_req_s *req_details, mapzen_route_cb callback, int request_id, void *user_data)
 {
        int ret = MAPZEN_ERROR_NONE;
        ret = start_route_service(req_details, callback, request_id, user_data);
index c7719cf56de34d2df06a4b77aa19df3820ad87c0..799bf1578c9670113cb61b8306dc41054e1ea588 100644 (file)
@@ -25,7 +25,7 @@
 #include "mapzen_restcurl.h"
 #include "mapzen_util.h"
 
-#define GEOCODE_URL    "https://open.mapzenapi.com/geocoding/v1/address?key=%s&inFormat=kvp&outFormat=json"
+#define GEOCODE_URL    "https://search.mapzen.com/v1/search?api_key=%s"
 
 int query_geocode_within_bounds(gchar *maps_key, char *address, coords_s top_left, coords_s bottom_right, int num_results, gpointer user_data)
 {
@@ -39,13 +39,14 @@ int query_geocode_within_bounds(gchar *maps_key, char *address, coords_s top_lef
 
        STRCPY(url, tmpStr);
 
-       snprintf(tmpStr, sizeof(tmpStr), "&boundingBox=%f,%f,%f,%f", top_left.latitude, top_left.longitude, bottom_right.latitude, bottom_right.longitude);
+       snprintf(tmpStr, sizeof(tmpStr), "&boundary.rect.min_lat=%f&boundary.rect.min_lon=%f&boundary.rect.max_lat=%f&boundary.rect.max_lon=%f",
+                       top_left.latitude, top_left.longitude, bottom_right.latitude, bottom_right.longitude);
        STRCAT(url, tmpStr);
 
-       snprintf(tmpStr, sizeof(tmpStr), "&maxResults=%d", num_results);
+       snprintf(tmpStr, sizeof(tmpStr), "&size=%d", num_results);
        STRCAT(url, tmpStr);
 
-       snprintf(tmpStr, sizeof(tmpStr), "&location=%s", address);
+       snprintf(tmpStr, sizeof(tmpStr), "&layers=address&text=%s", address);
        STRCAT(url, tmpStr);
 
        add_handle(url, REQ_TYPE_GEOCODE, user_data);
@@ -66,10 +67,10 @@ int query_geocode(gchar *maps_key, char *address, int num_results, gpointer user
 
        STRCPY(url, tmpStr);
 
-       snprintf(tmpStr, sizeof(tmpStr), "&maxResults=%d", num_results);
+       snprintf(tmpStr, sizeof(tmpStr), "&size=%d", num_results);
        STRCAT(url, tmpStr);
 
-       snprintf(tmpStr, sizeof(tmpStr), "&location=%s", address);
+       snprintf(tmpStr, sizeof(tmpStr), "&layers=address&text=%s", address);
        STRCAT(url, tmpStr);
 
        add_handle(url, REQ_TYPE_GEOCODE, user_data);
index 34a847d8afbf2a713df3ceec1e2d82da1937d35c..34cb8070e69905d5449bdac8ef7c01c9002f29cd 100644 (file)
@@ -17,7 +17,7 @@
 #include <maps_coordinates.h>
 
 #include <stdlib.h>
-#include "rapidjson/rapidjson.h"
+#include "rapidjson/document.h"
 #include "mapzen_jsonparser.hpp"
 #include "mapzen_queue.h"
 #include "mapzen_debug.h"
 #include <string>
 #include <vector>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define ROUTE_UNIT_CONVERSION_MILE_TO_M(x)     (1609.34 * (x))
 #define ROUTE_UNIT_CONVERSION_MILE_TO_KM(x)    (1.60934 * (x))
 #define ROUTE_UNIT_CONVERSION_MILE_TO_FT(x)    (5280 * (x))
@@ -120,16 +124,64 @@ static mapzen_error_e __convert_status(int status)
        return error;
 }
 
+bool __get_string(const rapidjson::Value& obj, const char* key, char** value)
+{
+       //if we have the key and its not an empty value
+       rapidjson::Value::ConstMemberIterator itr = obj.FindMember(key);
+       if(itr != obj.MemberEnd() && itr->value.GetStringLength()){
+               (*value) = (gchar *)g_malloc(itr->value.GetStringLength() + 1);
+               strncpy((*value), itr->value.GetString(), itr->value.GetStringLength());
+       }//we had nothing
+       else
+               (*value) = NULL;
+       //is this something
+       return *value != NULL;
+}
+
 /************ GEOCODE ***************/
 
 
 static void __parse_geocode_response(char *response, int size, int *status, GList **coordsList)
 {
+       MAP_DEBUG("Inside __parse_geocode_response..");
+
+
        if (!response || !status || !coordsList) return;
 
        *coordsList = NULL;
 
-       //TODO:
+       //crack open that json
+       rapidjson::Document document;
+       document.Parse(std::string(response, size).c_str());
+       rapidjson::Value::ConstMemberIterator features = document.FindMember("features");
+       if(features != document.MemberEnd() && features->value.IsArray()) {
+               //for each feature
+               for (rapidjson::Value::ConstValueIterator f = features->value.Begin(); f != features->value.End(); ++f) {
+                       //it has to have geometry
+                       rapidjson::Value::ConstMemberIterator geom = f->FindMember("geometry");
+                       if(geom != f->MemberEnd()) {
+                               //skip non-points
+                               rapidjson::Value::ConstMemberIterator type = geom->value.FindMember("type");
+                               if(type == geom->value.MemberEnd() || strcmp(type->value.GetString(), "Point"))
+                                       continue;
+                               //get actual points
+                               rapidjson::Value::ConstMemberIterator coords = geom->value.FindMember("coordinates");
+                               if(coords == geom->value.MemberEnd() || !coords->value.IsArray() || coords->value.Size() != 2)
+                                       continue;
+
+                               coords_s *coord = (coords_s *)g_malloc0(sizeof(coords_s));
+                               if (coord != NULL) {
+                                       coord->latitude = coords->value[0].GetDouble();
+                                       coord->longitude = coords->value[1].GetDouble();
+                               }
+
+                               if (*coordsList == NULL)
+                                       *coordsList = g_list_append(*coordsList, coord);
+                               else
+                                       *coordsList = g_list_insert_before(*coordsList, NULL, coord);
+                       }
+               }
+       }
 }
 
 /****************** REVERSE GEOCODE *********************/
@@ -140,7 +192,59 @@ static void __parse_revgeocode_response(char *response, int size, int *status, m
 
        *respAddr = NULL;
 
-       //TODO:
+       //crack open that json
+       rapidjson::Document document;
+       document.Parse(std::string(response, size).c_str());
+       rapidjson::Value::ConstMemberIterator features = document.FindMember("features");
+       if(features != document.MemberEnd() && features->value.IsArray()) {
+               //for each feature
+               for (rapidjson::Value::ConstValueIterator f = features->value.Begin(); f != features->value.End(); ++f) {
+                       //it has to have geometry
+                       rapidjson::Value::ConstMemberIterator geom = f->FindMember("geometry");
+                       if(geom != f->MemberEnd()) {
+                               //skip non-points
+                               rapidjson::Value::ConstMemberIterator type = geom->value.FindMember("type");
+                               if(type == geom->value.MemberEnd() || strcmp(type->value.GetString(), "Point"))
+                                       continue;
+                               //get actual points
+                               rapidjson::Value::ConstMemberIterator coords = geom->value.FindMember("coordinates");
+                               if(coords == geom->value.MemberEnd() || !coords->value.IsArray() || coords->value.Size() != 2)
+                                       continue;
+                               maps_coordinates_s coord;
+                               coord.longitude = coords->value[0].GetDouble();
+                               coord.latitude = coords->value[1].GetDouble();
+                               //NOTE: it seems as though the tizen maps plugin api assumes that reverse geocode results will
+                               //actually be at the coordinates where you requested the reverse geocode. the mapzen api can return
+                               //POIS which are some distance away from the location and currently this is not accounted for :o(
+
+                               //get out the address information
+                               rapidjson::Value::ConstMemberIterator properties = f->FindMember("properties");
+                               if(properties != f->MemberEnd()) {
+                                       //fill this out as we go
+                                       *respAddr = (mapzen_address_resp_s *)g_malloc(sizeof(mapzen_address_resp_s));
+                                       bool something = false;
+                                       something = __get_string(properties->value, "street", &(*respAddr)->street) || something;
+                                       something = __get_string(properties->value, "neighbourhood", &(*respAddr)->neighbourhood) || something;
+                                       something = __get_string(properties->value, "housenumber", &(*respAddr)->housenumber) || something;
+                                       something = __get_string(properties->value, "localadmin", &(*respAddr)->localadmin) || something;
+                                       something = __get_string(properties->value, "county", &(*respAddr)->county) || something;
+                                       something = __get_string(properties->value, "region", &(*respAddr)->region) || something;
+                                       something = __get_string(properties->value, "country", &(*respAddr)->country) || something;
+                                       something = __get_string(properties->value, "country_a", &(*respAddr)->country_a) || something;
+                                       something = __get_string(properties->value, "postalcode", &(*respAddr)->postalcode) || something;
+                                       //if everything was null thats pretty much unusable
+                                       //TODO: these are pretty weak criteria..
+                                       if(!something) {
+                                               g_free(*respAddr);
+                                               (*respAddr) = NULL;
+                                       }//forget the rest, we have one with something in it
+                                       else
+                                               break;
+                               }
+                       }
+               }
+
+       }
 }
 
 /****************  PLACE SEARCH ********************/
@@ -356,3 +460,7 @@ void post_curl_response(char *response, int size, mapzen_resp_type type, void *u
                }
        }
 }
+
+#ifdef __cplusplus
+}
+#endif
index 9a766eb94bf9e9b3ba302101c4989933b9513daa..7b356f090b9c47ab3059a112cf813a22db6cd43f 100644 (file)
 
 #include "mapzen_server_private.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void post_curl_response(char *response, int size, mapzen_resp_type type, void *user_data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _MAPZEN_JSONPARSER_H_ */
index e4b08c07f5fe2541e5a8305978db9c2e360388bd..99a681dd7f0689ff5a2da15e169997d85ce9697e 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <stdio.h>
-#include<stdlib.h>
+#include <stdlib.h>
 #include "mapzen_queue.h"
 #include "mapzen_geocode.h"
 #include "mapzen_revgeocode.h"
@@ -724,37 +724,37 @@ static void __free_revgeocode_response(void *ptr)
        MapzenRevGeocodeResponseData *revGeocodeData = (MapzenRevGeocodeResponseData *) (ptr);
        if (revGeocodeData) {
                if (revGeocodeData->addressDetails) {
-                       if (revGeocodeData->addressDetails->street_add) {
-                               g_free(revGeocodeData->addressDetails->street_add);
-                               revGeocodeData->addressDetails->street_add = NULL;
+                       if (revGeocodeData->addressDetails->street) {
+                               g_free(revGeocodeData->addressDetails->street);
+                               revGeocodeData->addressDetails->street = NULL;
                        }
                        if (revGeocodeData->addressDetails->neighbourhood) {
                                g_free(revGeocodeData->addressDetails->neighbourhood);
                                revGeocodeData->addressDetails->neighbourhood = NULL;
                        }
-                       if (revGeocodeData->addressDetails->city) {
-                               g_free(revGeocodeData->addressDetails->city);
-                               revGeocodeData->addressDetails->city = NULL;
+                       if (revGeocodeData->addressDetails->localadmin) {
+                               g_free(revGeocodeData->addressDetails->localadmin);
+                               revGeocodeData->addressDetails->localadmin = NULL;
                        }
                        if (revGeocodeData->addressDetails->county) {
                                g_free(revGeocodeData->addressDetails->county);
                                revGeocodeData->addressDetails->county = NULL;
                        }
-                       if (revGeocodeData->addressDetails->state) {
-                               g_free(revGeocodeData->addressDetails->state);
-                               revGeocodeData->addressDetails->state = NULL;
+                       if (revGeocodeData->addressDetails->region) {
+                               g_free(revGeocodeData->addressDetails->region);
+                               revGeocodeData->addressDetails->region = NULL;
                        }
                        if (revGeocodeData->addressDetails->country) {
                                g_free(revGeocodeData->addressDetails->country);
                                revGeocodeData->addressDetails->country = NULL;
                        }
-                       if (revGeocodeData->addressDetails->country_code) {
-                               g_free(revGeocodeData->addressDetails->country_code);
-                               revGeocodeData->addressDetails->country_code = NULL;
+                       if (revGeocodeData->addressDetails->country_a) {
+                               g_free(revGeocodeData->addressDetails->country_a);
+                               revGeocodeData->addressDetails->country_a = NULL;
                        }
-                       if (revGeocodeData->addressDetails->postal_code) {
-                               g_free(revGeocodeData->addressDetails->postal_code);
-                               revGeocodeData->addressDetails->postal_code = NULL;
+                       if (revGeocodeData->addressDetails->postalcode) {
+                               g_free(revGeocodeData->addressDetails->postalcode);
+                               revGeocodeData->addressDetails->postalcode = NULL;
                        }
 
                        g_free(revGeocodeData->addressDetails);
@@ -779,41 +779,41 @@ static void __free_place_response(void *ptr)
                        mapzen_place_resp_s *mapzen_place = (mapzen_place_resp_s *) place->data;
 
                        if (mapzen_place->address) {
-                                       if (mapzen_place->address->street_add) {
-                                               g_free(mapzen_place->address->street_add);
-                                               mapzen_place->address->street_add = NULL;
+                                       if (mapzen_place->address->street) {
+                                               g_free(mapzen_place->address->street);
+                                               mapzen_place->address->street = NULL;
                                        }
                                        if (mapzen_place->address->neighbourhood) {
                                                g_free(mapzen_place->address->neighbourhood);
                                                mapzen_place->address->neighbourhood = NULL;
                                        }
-                                       if (mapzen_place->address->building_number) {
-                                               g_free(mapzen_place->address->building_number);
-                                               mapzen_place->address->building_number = NULL;
+                                       if (mapzen_place->address->housenumber) {
+                                               g_free(mapzen_place->address->housenumber);
+                                               mapzen_place->address->housenumber = NULL;
                                        }
-                                       if (mapzen_place->address->city) {
-                                               g_free(mapzen_place->address->city);
-                                               mapzen_place->address->city = NULL;
+                                       if (mapzen_place->address->localadmin) {
+                                               g_free(mapzen_place->address->localadmin);
+                                               mapzen_place->address->localadmin = NULL;
                                        }
                                        if (mapzen_place->address->county) {
                                                g_free(mapzen_place->address->county);
                                                mapzen_place->address->county = NULL;
                                        }
-                                       if (mapzen_place->address->state) {
-                                               g_free(mapzen_place->address->state);
-                                               mapzen_place->address->state = NULL;
+                                       if (mapzen_place->address->region) {
+                                               g_free(mapzen_place->address->region);
+                                               mapzen_place->address->region = NULL;
                                        }
                                        if (mapzen_place->address->country) {
                                                g_free(mapzen_place->address->country);
                                                mapzen_place->address->country = NULL;
                                        }
-                                       if (mapzen_place->address->country_code) {
-                                               g_free(mapzen_place->address->country_code);
-                                               mapzen_place->address->country_code = NULL;
+                                       if (mapzen_place->address->country_a) {
+                                               g_free(mapzen_place->address->country_a);
+                                               mapzen_place->address->country_a = NULL;
                                        }
-                                       if (mapzen_place->address->postal_code) {
-                                               g_free(mapzen_place->address->postal_code);
-                                               mapzen_place->address->postal_code = NULL;
+                                       if (mapzen_place->address->postalcode) {
+                                               g_free(mapzen_place->address->postalcode);
+                                               mapzen_place->address->postalcode = NULL;
                                        }
                                g_free(mapzen_place->address);
                                mapzen_place->address = NULL;
@@ -919,10 +919,6 @@ static void __free_route_response(void *ptr)
 
 int mapzen_init_queue()
 {
-#if !GLIB_CHECK_VERSION(2, 35, 0)
-       g_type_init();          /* Needed for using json in Emulator */
-#endif
-
        pthread_mutex_init(&__requestLock, NULL);
 
        /* Queue initialize */
index ebe173cc61958b9fb4dad7166bed77524e71ff25..24eba4a7844e5127c2c15582baea2fb23ca0c813 100644 (file)
@@ -25,7 +25,7 @@
 #include "mapzen_restcurl.h"
 #include "mapzen_util.h"
 
-#define REVERSE_GEOCODE_URL    "https://search.mapzen.com/v1/reverse?size=1&point.lat=%f&point.lon=%f&api_key=%s"
+#define REVERSE_GEOCODE_URL    "https://search.mapzen.com/v1/reverse?size=10&layers=address,locality&point.lat=%f&point.lon=%f&api_key=%s"
 
 int query_revgeocode(gchar *maps_key, gdouble latitude, gdouble longitude, gpointer user_data)
 {
index 356bf5268fb82f423a230433cebaef18cb0a158c..ddf1264d0ad3d470b07df812170e3853e06f91ef 100644 (file)
@@ -134,15 +134,15 @@ typedef struct {
 } mapzen_tiledata_req_s;
 
 typedef struct {
-       gchar *street_add;
+       gchar *street;
        gchar *neighbourhood;
-       gchar *building_number;
-       gchar *city;
+       gchar *housenumber;
+       gchar *localadmin;
        gchar *county;
-       gchar *state;
+       gchar *region;
        gchar *country;
-       gchar *country_code;
-       gchar *postal_code;
+       gchar *country_a;
+       gchar *postalcode;
 } mapzen_address_resp_s;
 
 typedef struct {
index c00bf8bfa9188437e927bdccb875c5ab03e17e26..a87258b281c947a7cdbd47f0a678775f31262bf8 100644 (file)
@@ -148,7 +148,40 @@ static bool __replace_space(char *place_name, char **modified_place_name)
        return false;
 }
 
-EXPORT_API int maps_plugin_init(maps_plugin_h *plugin)
+
+/*MASSIVE TODO:
+ *
+ * THE TIZEN API REQUIRES A BUNCH MORE FUNCTIONS A LOT OF WHICH HAVE TO DO WITH MAP RENDERING
+ * TO BE ABLE TO LOAD THE LIBRARY IN A COMPATIBLE WAY. HERE WE STUB OUT THE METHODS BUT DO NO
+ * IMPLEMENTING JUST SO WE CAN TEST THE STUFF WE HAVE DONE...
+ */
+
+EXPORT_API int maps_plugin_multi_reverse_geocode(const maps_coordinates_list_h geocode_list,
+       const maps_preference_h preference, maps_service_multi_reverse_geocode_cb callback,
+       void *user_data, int *request_id){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const maps_place_filter_h filter,
+       maps_preference_h preference, maps_service_search_place_list_cb callback, void* user_data, int* request_id){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_get_place_details(const char* url,
+       maps_service_get_place_details_cb callback, void* user_data, int* request_id){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_destroy_map_view(maps_view_h hView){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_render_map(maps_view_h hView,
+       const maps_coordinates_h coordinates, double zoom_factor, double rotation_angle){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_move_center(maps_view_h hView, int delta_x, int delta_y){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_set_scalebar(maps_view_h hView, bool enable){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, int x, int y, int w, int h){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_screen_to_geography(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h mapsCoord, int* x, int* y){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level){return  MAPS_ERROR_NOT_SUPPORTED ;}
+EXPORT_API int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *center){return  MAPS_ERROR_NOT_SUPPORTED ;}
+
+/*END MASSIVE TODO:
+ */
+
+EXPORT_API int maps_plugin_init_module(maps_plugin_h *plugin, const char* module)
 {
        if (!plugin)
                return MAPS_ERROR_INVALID_PARAMETER;
@@ -166,6 +199,11 @@ EXPORT_API int maps_plugin_init(maps_plugin_h *plugin)
        return __convert_to_maps_error(ret);
 }
 
+EXPORT_API int maps_plugin_init(maps_plugin_h *plugin)
+{
+       return maps_plugin_init_module(plugin, NULL);
+}
+
 EXPORT_API int maps_plugin_shutdown(maps_plugin_h plugin)
 {
        MAPS_LOGD("PLUGIN SHUTDOWN");
@@ -242,7 +280,7 @@ EXPORT_API int maps_plugin_get_info(maps_plugin_info_h *info)
                return MAPS_ERROR_INVALID_PARAMETER;
 
        maps_plugin_info_create(info);
-       maps_plugin_info_set_provider_name(*info, "MAPZEN");
+       maps_plugin_info_set_provider_name(*info, "mapzen");
 
        return MAPS_ERROR_NONE;
 }
@@ -570,13 +608,14 @@ static void __mapzen_reverse_geocode_cb(mapzen_error_e result, int request_id, m
                maps_address_h addr = NULL;
                maps_address_create(&addr);
 
-               maps_address_set_street(addr, address->street_add);
-               maps_address_set_city(addr, address->city);
+               //TODO: housenumber??
+               maps_address_set_street(addr, address->street);
+               maps_address_set_city(addr, address->localadmin);
                maps_address_set_county(addr, address->county);
-               maps_address_set_state(addr, address->state);
+               maps_address_set_state(addr, address->region);
                maps_address_set_country(addr, address->country);
-               maps_address_set_country_code(addr, address->country_code);
-               maps_address_set_postal_code(addr, address->postal_code);
+               maps_address_set_country_code(addr, address->country_a);
+               maps_address_set_postal_code(addr, address->postalcode);
 
                calldata_reverse_geocode->callback(MAPS_ERROR_NONE, calldata_reverse_geocode->reqID, index, total_count, addr, calldata_reverse_geocode->data);
        }
@@ -1030,14 +1069,14 @@ static void __mapzen_place_search_cb(mapzen_error_e result, int request_id, GLis
                                        maps_address_h addr = NULL;
                                        maps_address_create(&addr);
 
-                                       maps_address_set_street(addr, mapzen_place->address->street_add);
-                                       maps_address_set_building_number(addr, mapzen_place->address->building_number);
-                                       maps_address_set_city(addr, mapzen_place->address->city);
+                                       maps_address_set_street(addr, mapzen_place->address->street);
+                                       maps_address_set_building_number(addr, mapzen_place->address->housenumber);
+                                       maps_address_set_city(addr, mapzen_place->address->localadmin);
                                        maps_address_set_county(addr, mapzen_place->address->county);
-                                       maps_address_set_state(addr, mapzen_place->address->state);
+                                       maps_address_set_state(addr, mapzen_place->address->region);
                                        maps_address_set_country(addr, mapzen_place->address->country);
-                                       maps_address_set_country_code(addr, mapzen_place->address->country_code);
-                                       maps_address_set_postal_code(addr, mapzen_place->address->postal_code);
+                                       maps_address_set_country_code(addr, mapzen_place->address->country_a);
+                                       maps_address_set_postal_code(addr, mapzen_place->address->postalcode);
                                        maps_address_set_freetext(addr, mapzen_place->display_name);
 
                                        maps_place_set_address(place, addr);