From fd35b351f198c8c87aacdf7c5c57b84c560b1e10 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Mon, 18 Jun 2012 20:00:07 -0400 Subject: [PATCH] Exif_GPS Version 3. --- .../exif_gps/controllers/admin_exif_gps.php | 31 +++- 3.0/modules/exif_gps/controllers/exif_gps.php | 76 ++++++--- .../exif_gps/helpers/exif_gps_block.php | 17 +- .../exif_gps/helpers/exif_gps_event.php | 52 ++++++ .../exif_gps/helpers/exif_gps_installer.php | 18 +- .../exif_gps/helpers/exif_gps_task.php | 5 - .../exif_gps/helpers/exif_gps_theme.php | 3 +- .../images/exif_gps-loading-map-large.gif | Bin 0 -> 2892 bytes .../exif_gps/js/markerclusterer_compiled.js | 21 +++ 3.0/modules/exif_gps/module.info | 2 +- .../exif_gps/views/admin_exif_gps.html.php | 2 +- .../views/exif_gps_coordinates_xml.html.php | 13 ++ .../views/exif_gps_dynamic2_sidebar.html.php | 65 -------- .../views/exif_gps_dynamic_sidebar.html.php | 107 ++++++++++-- .../exif_gps/views/exif_gps_map.html.php | 157 +++++++++++------- .../views/exif_gps_static_sidebar.html.php | 8 +- .../views/user_profile_exif_gps.html.php | 126 ++++++++++++++ 17 files changed, 525 insertions(+), 178 deletions(-) create mode 100644 3.0/modules/exif_gps/images/exif_gps-loading-map-large.gif create mode 100644 3.0/modules/exif_gps/js/markerclusterer_compiled.js create mode 100644 3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php delete mode 100644 3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php create mode 100644 3.0/modules/exif_gps/views/user_profile_exif_gps.html.php diff --git a/3.0/modules/exif_gps/controllers/admin_exif_gps.php b/3.0/modules/exif_gps/controllers/admin_exif_gps.php index ca3003f6..40ef47ba 100644 --- a/3.0/modules/exif_gps/controllers/admin_exif_gps.php +++ b/3.0/modules/exif_gps/controllers/admin_exif_gps.php @@ -36,17 +36,18 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller { // Make sure the user filled out the form properly. $form = $this->_get_admin_form(); if ($form->validate()) { - Kohana_Log::add("error",print_r($form,1)); - // Save settings to Gallery's database. module::set_var("exif_gps", "googlemap_api_key", $form->Global->google_api_key->value); module::set_var("exif_gps", "googlemap_max_autozoom", $form->Global->max_auto_zoom_level->value); + module::set_var("exif_gps", "markercluster_gridsize", $form->markercluster->markercluster_gridsize->value); + module::set_var("exif_gps", "markercluster_maxzoom", $form->markercluster->markercluster_maxzoom->value); module::set_var("exif_gps", "sidebar_zoom", $form->Sidebar->sidebar_default_zoom->value); module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value); module::set_var("exif_gps", "sidebar_maptype", $form->Sidebar->sidebar_maptype->value); module::set_var("exif_gps", "largemap_maptype", $form->LargeMap->largemap_maptype->value); $checkbox_album = false; $checkbox_user = false; + $checkbox_restriction = false; for ($i = 0; $i < count($form->Global->toolbar_map_album); $i++) { if ($form->Global->toolbar_map_album->value[$i] == "checkbox_album") { $checkbox_album = true; @@ -57,8 +58,14 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller { $checkbox_user = true; } } + for ($i = 0; $i < count($form->Global->restrict_maps); $i++) { + if ($form->Global->restrict_maps->value[$i] == "checkbox_restriction") { + $checkbox_restriction = true; + } + } module::set_var("exif_gps", "toolbar_map_album", $checkbox_album); module::set_var("exif_gps", "toolbar_map_user", $checkbox_user); + module::set_var("exif_gps", "restrict_maps", $checkbox_restriction); // Display a success message and redirect back to the TagsMap admin page. message::success(t("Your settings have been saved.")); @@ -81,18 +88,32 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller { $gps_global_group = $form->group("Global") ->label(t("Global Settings")); $gps_global_group->input("google_api_key") - ->label(t("Google Maps API Key")) - ->value(module::get_var("exif_gps", "googlemap_api_key")) - ->rules("required"); + ->label(t("Google APIs Console key (optional):")) + ->value(module::get_var("exif_gps", "googlemap_api_key")); $gps_global_group->input("max_auto_zoom_level") ->label(t("Maximum Auto-Zoom Level:")) ->value(module::get_var("exif_gps", "googlemap_max_autozoom")); $checkbox_user["checkbox_user"] = array(t("Show \"Map this user\" icon?"), module::get_var("exif_gps", "toolbar_map_user")); $checkbox_album["checkbox_album"] = array(t("Show \"Map this album\" icon?"), module::get_var("exif_gps", "toolbar_map_album")); + $checkbox_restriction["checkbox_restriction"] = array(t("Restrict maps to registered users?"), module::get_var("exif_gps", "restrict_maps")); $gps_global_group->checklist("toolbar_map_album") ->options($checkbox_album); $gps_global_group->checklist("toolbar_map_user") ->options($checkbox_user); + $gps_global_group->checklist("restrict_maps") + ->options($checkbox_restriction); + + // Create a group for marker cluster settings + $gps_markercluster = $form->group("markercluster") + ->label(t("Marker Cluster Settings")); + $gps_markercluster->input("markercluster_gridsize") + ->label(t("Grid Size")) + ->value(module::get_var("exif_gps", "markercluster_gridsize")) + ->rules("required"); + $gps_markercluster->input("markercluster_maxzoom") + ->label(t("Max Zoom")) + ->value(module::get_var("exif_gps", "markercluster_maxzoom")) + ->rules("required"); // Create a group for sidebar settings $gps_sidebar = $form->group("Sidebar") diff --git a/3.0/modules/exif_gps/controllers/exif_gps.php b/3.0/modules/exif_gps/controllers/exif_gps.php index afdcd957..ec29c431 100644 --- a/3.0/modules/exif_gps/controllers/exif_gps.php +++ b/3.0/modules/exif_gps/controllers/exif_gps.php @@ -18,33 +18,61 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class EXIF_GPS_Controller extends Controller { + public function item($item_id) { + // Make sure the context callback is set to album when linking to photos from map pages. + $item = ORM::factory("item", $item_id); + access::required("view", $item); + item::set_display_context_callback("Albums_Controller::get_display_context"); + url::redirect($item->abs_url()); + } + + public function xml($query_type, $query_id) { + // Generate an xml output of the photos to be mapped. + // $query_type can be either "album" or "user", $query_id is the id# of the album or user to map. + + // If the user can't view maps, don't let them view the xml. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + throw new Kohana_404_Exception(); + } + + $items = ""; + if ($query_type == "user") { + $items = ORM::factory("item") + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->where("items.owner_id", "=", $query_id) + ->viewable() + ->order_by("exif_coordinates.latitude", "ASC") + ->find_all(); + } elseif ($query_type == "album") { + $items = ORM::factory("item", $query_id) + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->viewable() + ->order_by("exif_coordinates.latitude", "ASC") + ->descendants(); + } + + $v = new View("exif_gps_coordinates_xml.html"); + $v->items = $items; + header("Content-type: text/xml; charset=utf-8"); + print $v; + } + public function map($map_type, $type_id) { // Map all items in the specified album or user. // Valid values for $map_type are "album" or "user", $type_id is either an // album id# or a user id#. + // If the user can't view maps, throw a 404 error. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + throw new Kohana_404_Exception(); + } + + // Figure out what to display for the page title. $map_title = ""; if ($map_type == "album") { - // Generate an array of all items in the current album that have exif gps - // coordinates and order by latitude (to group items w/ the same - // coordinates together). - $items = ORM::factory("item", $type_id) - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants(); $curr_album = ORM::factory("item")->where("id", "=", $type_id)->find_all(); $map_title = $curr_album[0]->title; } elseif ($map_type == "user") { - // Generate an array of all items uploaded by the current user that - // have exif gps coordinates and order by latitude (to group items - // w/ the same coordinates together). - $items = ORM::factory("item") - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->where("items.owner_id", "=", $type_id) - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->find_all(); $curr_user = ORM::factory("user")->where("id", "=", $type_id)->find_all(); $map_title = $curr_user[0]->full_name . "'s " . t("Photos"); } @@ -79,11 +107,15 @@ class EXIF_GPS_Controller extends Controller { } // Figure out default map type. $int_map_type = module::get_var("exif_gps", "largemap_maptype"); - if ($int_map_type == 0) $map_type = "ROADMAP"; - if ($int_map_type == 1) $map_type = "SATELLITE"; - if ($int_map_type == 2) $map_type = "HYBRID"; - if ($int_map_type == 3) $map_type = "TERRAIN"; - $template->content->map_type = $map_type; + if ($int_map_type == 0) $map_display_type = "ROADMAP"; + if ($int_map_type == 1) $map_display_type = "SATELLITE"; + if ($int_map_type == 2) $map_display_type = "HYBRID"; + if ($int_map_type == 3) $map_display_type = "TERRAIN"; + $template->content->map_type = $map_display_type; + + // These are used to set up the URL to the xml file. + $template->content->query_type = $map_type; + $template->content->query_id = $type_id; // Load in module preferences. $template->content->items = $items; diff --git a/3.0/modules/exif_gps/helpers/exif_gps_block.php b/3.0/modules/exif_gps/helpers/exif_gps_block.php index e581a62f..12a7f1bd 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_block.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_block.php @@ -26,6 +26,11 @@ class exif_gps_block_Core { static function get($block_id, $theme) { $block = ""; + // Make sure the user can view maps before displaying any sidebars. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + switch ($block_id) { case "exif_gps_maps": // Display links to a map of the current album and @@ -46,13 +51,13 @@ class exif_gps_block_Core { ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->descendants_count(); + ->descendants_count(1); $user_items_count = ORM::factory("item") ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->where("items.owner_id", "=", $item->owner_id) ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->count_all(); + ->count_all(1); if (($album_items_count > 0) || ($user_items_count > 0)) { $block = new Block(); @@ -130,17 +135,19 @@ class exif_gps_block_Core { ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->descendants(); + ->descendants(1); if (count($items) > 0) { $block = new Block(); $block->css_id = "g-exif-gps-location"; $block->title = t("Location"); - $block->content = new View("exif_gps_dynamic2_sidebar.html"); + $block->content = new View("exif_gps_dynamic_sidebar.html"); if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "ROADMAP"; if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE"; if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID"; if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN"; - $block->content->items = $items; + $block->content->album_id = $theme->item->id; + $block->content->latitude = 0; + $block->content->longitude = 0; $block->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); } } diff --git a/3.0/modules/exif_gps/helpers/exif_gps_event.php b/3.0/modules/exif_gps/helpers/exif_gps_event.php index 7abe16a5..3b383203 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_event.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_event.php @@ -99,6 +99,13 @@ class exif_gps_event_Core { } static function photo_menu($menu, $theme) { + // Adds album and user map icons to photo pages. + + // Do not display icons if the user can't view the page. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + $album_id = ""; $item = $theme->item; if ($item->is_album()) { @@ -139,6 +146,13 @@ class exif_gps_event_Core { } static function movie_menu($menu, $theme) { + // Adds album and user map icons to movie pages. + + // Do not display icons if the user can't view the page. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + $album_id = ""; $item = $theme->item; if ($item->is_album()) { @@ -179,6 +193,13 @@ class exif_gps_event_Core { } static function album_menu($menu, $theme) { + // Adds album and user map icons to album pages. + + // Do not display icons if the user can't view the page. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + $album_id = ""; $item = $theme->item; if ($item->is_album()) { @@ -217,4 +238,35 @@ class exif_gps_event_Core { ->css_id("g-exif-gps-user-link")); } } + + static function show_user_profile($data) { + // Display a map on the user profile pages. + + // Make sure the user can view maps before displaying one. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + + // If there's nothing to map, hide the map. + $items = ORM::factory("item") + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->where("items.owner_id", "=", $data->user->id) + ->viewable() + ->find_all(1); + if (count($items) == 0) { + return; + } + + // Display the map block. + $v = new View("user_profile_exif_gps.html"); + $int_map_type = module::get_var("exif_gps", "largemap_maptype"); + if ($int_map_type == 0) $map_type = "ROADMAP"; + if ($int_map_type == 1) $map_type = "SATELLITE"; + if ($int_map_type == 2) $map_type = "HYBRID"; + if ($int_map_type == 3) $map_type = "TERRAIN"; + $v->map_type = $map_type; + $v->user_id = $data->user->id; + $v->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); + $data->content[] = (object) array("title" => t("Photo Map"), "view" => $v); + } } diff --git a/3.0/modules/exif_gps/helpers/exif_gps_installer.php b/3.0/modules/exif_gps/helpers/exif_gps_installer.php index df17a746..4f346b4c 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_installer.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_installer.php @@ -33,6 +33,8 @@ class exif_gps_installer { // If tagsmap is installed, copy the API key over. if (module::is_active("tagsmap")) { module::set_var("exif_gps", "googlemap_api_key", module::get_var("tagsmap", "googlemap_api_key")); + } else { + module::set_var("exif_gps", "googlemap_api_key", ""); } // Set some default values. @@ -40,9 +42,15 @@ class exif_gps_installer { module::set_var("exif_gps", "sidebar_mapformat", "1"); module::set_var("exif_gps", "sidebar_maptype", "1"); module::set_var("exif_gps", "largemap_maptype", "2"); + module::set_var("exif_gps", "googlemap_max_autozoom", ""); + module::set_var("exif_gps", "toolbar_map_album", "0"); + module::set_var("exif_gps", "toolbar_map_user", "0"); + module::set_var("exif_gps", "markercluster_gridsize", "50"); + module::set_var("exif_gps", "markercluster_maxzoom", "15"); + module::set_var("exif_gps", "restrict_maps", "0"); // Set the module version number. - module::set_version("exif_gps", 2); + module::set_version("exif_gps", 3); } static function upgrade($version) { @@ -50,6 +58,8 @@ class exif_gps_installer { // If tagsmap is installed, copy the API key over. if (module::is_active("tagsmap")) { module::set_var("exif_gps", "googlemap_api_key", module::get_var("tagsmap", "googlemap_api_key")); + } else { + module::set_var("exif_gps", "googlemap_api_key", ""); } // Set some default values. @@ -59,6 +69,12 @@ class exif_gps_installer { module::set_var("exif_gps", "largemap_maptype", "2"); module::set_version("exif_gps", 2); } + if ($version == 2) { + module::set_var("exif_gps", "markercluster_gridsize", "50"); + module::set_var("exif_gps", "markercluster_maxzoom", "15"); + module::set_var("exif_gps", "restrict_maps", "0"); + module::set_version("exif_gps", 3); + } } static function deactivate() { diff --git a/3.0/modules/exif_gps/helpers/exif_gps_task.php b/3.0/modules/exif_gps/helpers/exif_gps_task.php index 217ab644..61a34538 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_task.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_task.php @@ -50,11 +50,6 @@ class exif_gps_task_Core { $completed = $task->get("completed"); // Generate an array of the next 100 photos to check. - //$all_photos = ORM::factory("item") - // ->where("id", ">", $last_id) - // ->where("type", "=", "photo") - // ->order_by("id") - // ->find_all(100); // Check each photo in the array to see if it already has exif gps data associated with it. // If it doesn't, attempt to extract gps coordinates. diff --git a/3.0/modules/exif_gps/helpers/exif_gps_theme.php b/3.0/modules/exif_gps/helpers/exif_gps_theme.php index a4b76dcf..8a6bfd0c 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_theme.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_theme.php @@ -19,6 +19,7 @@ */ class exif_gps_theme_Core { static function head($theme) { - return $theme->css("exif_gps_menu.css"); + return $theme->css("exif_gps_menu.css") . + $theme->script("markerclusterer_compiled.js"); } } diff --git a/3.0/modules/exif_gps/images/exif_gps-loading-map-large.gif b/3.0/modules/exif_gps/images/exif_gps-loading-map-large.gif new file mode 100644 index 0000000000000000000000000000000000000000..a259e22f98737c00a56121fbd2eebba5e2d50556 GIT binary patch literal 2892 zcmd7U`#&4z9tUvkb}B(HTU#Qm)0QR@bgd$i>gCmg1Z|C0BB7_+5{X!AjNJ6LA`*Jl zNr<&YBoVctNQ7R{lEk{HlB;#CgT$?;HkAl^bg%O|XXnfxaGoEYU!Ldnyq@>#^L;L% zm=Hu@!g-suHg9a+w|DQ}q0#82e)Bu~L%~O)5A2T&-s$t%2P>AwHZOt?e3_V#k$B22 zi=TqqNc|rqCG9D{8sJdNepI<0*cc@E-0-}mBdS?fTRS(L z+a@3Wyr=cDnsmk`ey8eO`pJ0AkNR_C0hakJwQY9@t}3rt$n8czjgEOnD9{2R@)AY) zvE3#$h9`3dqwQJ{q#_-TG-pAwVPF;A6edS<^{^B@VU7{Gr26x|zvu70?KWAjNlAN_ zxVh=(Ywd*>>#tXQ?J8(E7B)csE`ZZWYY@V<3paLl=AyKRi-#VuJ1f&n4%@g#h`)*| z6K>&+{@dEH8q3^l+a1|pRux`zs*j@|+zfH9Kl@Di203ox!lS>bW5Bzhc* zqS_s|EaLtW;(W7P`G(UZ!%En!_eReb3e2<3gsQFOxSiQ^T;2yYg3i-ONi8w!i z_AuuV(TJoskSvfE6Pq-Eq+?%+LwF}B_b2+*!N%cF)@a*GzY$E(=)^yp0 zZ$z{^q~Po2d%W?mILNurf?ox!?g`w>sN3T6YASCxECn)>tQ`VuEbSdO0&WVRsXa-m` zF>e}bJkBBlp>%E_te-~?1(WeD7P?*dOVU2G*r-EFy7Z&TSb3CK4`;ZRwyKbk~o}ux1cR(}WM?Y^* z2)y+bJQ&^=u-!q3MhtE!gFwAJ3Hb zShw@}$Z4SyR;dcHU^`W8||6vem$(1^|3IE!X!gpYU($S;{Ylpdudi`@Zanx+`qk>w zE^Nv#hBe8K9*AIEPVQ(GwywK)mIz%HNOP2(;z`v4OO+9e2?XI0a}}Aoyg7gprVE=R zmmo`v6*!o4>9|s!Fm4oAvltjJVQGjxcKeZNwqgEQUL&<7S2u!z(PMN=QhAs@ z;5VL&JOxUyG9=*EO1+9>B5E zbz~oy+=W~Jz4gsS!Lgfj&g6tAm3{hn7(DXUOvYQZK!3t&S+%x;blgG@JsE9~nypSD zBcUP9L?Txh1KHQ@u68m#xrrlXA_SV3h_|3_AdV{Lk@A~AfEfd!z|cT)b*OT{E|50P zws(}XWKX!@IP21pWl+4f)P(o+;5#`iFAj2^&q*!)1Qd@P3~y=8z8n8^!MiNN`&8T5 z&%jUT##M;J_+_zwsN$u!jgi0B?l9nTrLm0HU$=UeT*rCX$b>_xZ*8;K-*xjn@znUx zgA`u*Xu$B7aL?mMHDAWu`$_mr^!gyPfScoYZ|EIgQxh*BOP-#a>0&JG^?x-R(w*C!rxAMC zJ~aC#1F}S1R*Z9~6Ew=!s%yOD8Zae+{c5CBZ!% zbe6Fc{7i~dM9;j%s|AY6Zb3Q3Pq^wz3z&kk)IqPQ!RR#^$CeH9!GH4t7QNfic84)b zyj<^t@br9b%-~5Y)>3)9j z=^rU4x%jb=Vbu1)KrG|MQ1zY{P2V^s&th%;`<;laETaYhoPmnbD~sFFVvC=`*(6g4 z*JU=x+Og>{ci31dZ)kjW<*4mHA+02~rYS0z%D^!|df}R9rbnud)IS cVuEA>uAf-H{QX(+C&vHb{}J{6zx#XpCopDIO8@`> literal 0 HcmV?d00001 diff --git a/3.0/modules/exif_gps/js/markerclusterer_compiled.js b/3.0/modules/exif_gps/js/markerclusterer_compiled.js new file mode 100644 index 00000000..4ddf3045 --- /dev/null +++ b/3.0/modules/exif_gps/js/markerclusterer_compiled.js @@ -0,0 +1,21 @@ +(function(){var d=null;function e(a){return function(b){this[a]=b}}function h(a){return function(){return this[a]}}var j; +function k(a,b,c){this.extend(k,google.maps.OverlayView);this.c=a;this.a=[];this.f=[];this.ca=[53,56,66,78,90];this.j=[];this.A=!1;c=c||{};this.g=c.gridSize||60;this.l=c.minimumClusterSize||2;this.J=c.maxZoom||d;this.j=c.styles||[];this.X=c.imagePath||this.Q;this.W=c.imageExtension||this.P;this.O=!0;if(c.zoomOnClick!=void 0)this.O=c.zoomOnClick;this.r=!1;if(c.averageCenter!=void 0)this.r=c.averageCenter;l(this);this.setMap(a);this.K=this.c.getZoom();var f=this;google.maps.event.addListener(this.c, +"zoom_changed",function(){var a=f.c.getZoom();if(f.K!=a)f.K=a,f.m()});google.maps.event.addListener(this.c,"idle",function(){f.i()});b&&b.length&&this.C(b,!1)}j=k.prototype;j.Q="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";j.P="png";j.extend=function(a,b){return function(a){for(var b in a.prototype)this.prototype[b]=a.prototype[b];return this}.apply(a,[b])};j.onAdd=function(){if(!this.A)this.A=!0,n(this)};j.draw=function(){}; +function l(a){if(!a.j.length)for(var b=0,c;c=a.ca[b];b++)a.j.push({url:a.X+(b+1)+"."+a.W,height:c,width:c})}j.S=function(){for(var a=this.o(),b=new google.maps.LatLngBounds,c=0,f;f=a[c];c++)b.extend(f.getPosition());this.c.fitBounds(b)};j.z=h("j");j.o=h("a");j.V=function(){return this.a.length};j.ba=e("J");j.I=h("J");j.G=function(a,b){for(var c=0,f=a.length,g=f;g!==0;)g=parseInt(g/10,10),c++;c=Math.min(c,b);return{text:f,index:c}};j.$=e("G");j.H=h("G"); +j.C=function(a,b){for(var c=0,f;f=a[c];c++)q(this,f);b||this.i()};function q(a,b){b.s=!1;b.draggable&&google.maps.event.addListener(b,"dragend",function(){b.s=!1;a.L()});a.a.push(b)}j.q=function(a,b){q(this,a);b||this.i()};function r(a,b){var c=-1;if(a.a.indexOf)c=a.a.indexOf(b);else for(var f=0,g;g=a.a[f];f++)if(g==b){c=f;break}if(c==-1)return!1;b.setMap(d);a.a.splice(c,1);return!0}j.Y=function(a,b){var c=r(this,a);return!b&&c?(this.m(),this.i(),!0):!1}; +j.Z=function(a,b){for(var c=!1,f=0,g;g=a[f];f++)g=r(this,g),c=c||g;if(!b&&c)return this.m(),this.i(),!0};j.U=function(){return this.f.length};j.getMap=h("c");j.setMap=e("c");j.w=h("g");j.aa=e("g"); +j.v=function(a){var b=this.getProjection(),c=new google.maps.LatLng(a.getNorthEast().lat(),a.getNorthEast().lng()),f=new google.maps.LatLng(a.getSouthWest().lat(),a.getSouthWest().lng()),c=b.fromLatLngToDivPixel(c);c.x+=this.g;c.y-=this.g;f=b.fromLatLngToDivPixel(f);f.x-=this.g;f.y+=this.g;c=b.fromDivPixelToLatLng(c);b=b.fromDivPixelToLatLng(f);a.extend(c);a.extend(b);return a};j.R=function(){this.m(!0);this.a=[]}; +j.m=function(a){for(var b=0,c;c=this.f[b];b++)c.remove();for(b=0;c=this.a[b];b++)c.s=!1,a&&c.setMap(d);this.f=[]};j.L=function(){var a=this.f.slice();this.f.length=0;this.m();this.i();window.setTimeout(function(){for(var b=0,c;c=a[b];b++)c.remove()},0)};j.i=function(){n(this)}; +function n(a){if(a.A)for(var b=a.v(new google.maps.LatLngBounds(a.c.getBounds().getSouthWest(),a.c.getBounds().getNorthEast())),c=0,f;f=a.a[c];c++)if(!f.s&&b.contains(f.getPosition())){for(var g=a,u=4E4,o=d,v=0,m=void 0;m=g.f[v];v++){var i=m.getCenter();if(i){var p=f.getPosition();if(!i||!p)i=0;else var w=(p.lat()-i.lat())*Math.PI/180,x=(p.lng()-i.lng())*Math.PI/180,i=Math.sin(w/2)*Math.sin(w/2)+Math.cos(i.lat()*Math.PI/180)*Math.cos(p.lat()*Math.PI/180)*Math.sin(x/2)*Math.sin(x/2),i=6371*2*Math.atan2(Math.sqrt(i), +Math.sqrt(1-i));i=this.l&&a.setMap(d); +a=this.c.getZoom();if((b=this.k.I())&&a>b)for(a=0;b=this.a[a];a++)b.setMap(this.c);else if(this.a.length0&&a.e[0]0&&a.e[1] diff --git a/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php b/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php new file mode 100644 index 00000000..c858a236 --- /dev/null +++ b/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php @@ -0,0 +1,13 @@ + +\n"; ?> + + +where("item_id", "=", $item->id)->find(); ?> +thumb_img(array("class" => "g-exif-gps-thumbnail"))); ?> + + +", ">", $str_thumb_html); ?> + + id}"); ?>" thumb="" /> + + diff --git a/3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php deleted file mode 100644 index f4f95799..00000000 --- a/3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - diff --git a/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php index ff28e101..4f085919 100644 --- a/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php @@ -1,22 +1,103 @@ - + - + + + +
+
+
+

+

+ " style="vertical-align: middle;"> +

+
+
diff --git a/3.0/modules/exif_gps/views/exif_gps_map.html.php b/3.0/modules/exif_gps/views/exif_gps_map.html.php index 0586fbd1..948afab6 100644 --- a/3.0/modules/exif_gps/views/exif_gps_map.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_map.html.php @@ -1,65 +1,81 @@ - + + +
dynamic_top() ?> @@ -89,5 +122,13 @@


-
+
+
+
+

+

+ " style="vertical-align: middle;"> +

+
+
dynamic_bottom() ?> diff --git a/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php index 11d80c74..39c4918a 100644 --- a/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php @@ -1,2 +1,8 @@ -&size=205x214&maptype=&markers=color:red|color:red|,&sensor=false"> + +&size=205x214&maptype=&markers=color:red|color:red|,&sensor=false"> diff --git a/3.0/modules/exif_gps/views/user_profile_exif_gps.html.php b/3.0/modules/exif_gps/views/user_profile_exif_gps.html.php new file mode 100644 index 00000000..1c0ef5ef --- /dev/null +++ b/3.0/modules/exif_gps/views/user_profile_exif_gps.html.php @@ -0,0 +1,126 @@ + + + + + + +
+
+
+

+

+ " style="vertical-align: middle;"> +

+
+