Enable the options on the new admin screen.
This commit is contained in:
parent
f1d7a4551b
commit
8a5fdd1237
@ -72,7 +72,7 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller {
|
|||||||
->value(module::get_var("exif_gps", "sidebar_zoom"))
|
->value(module::get_var("exif_gps", "sidebar_zoom"))
|
||||||
->rules("required");
|
->rules("required");
|
||||||
$gps_sidebar->dropdown("sidebar_mapformat")
|
$gps_sidebar->dropdown("sidebar_mapformat")
|
||||||
->label(t("Default Map Format"))
|
->label(t("Map Interface"))
|
||||||
->options(array(t("Static"), t("Interactive")))
|
->options(array(t("Static"), t("Interactive")))
|
||||||
->selected(module::get_var("exif_gps", "sidebar_mapformat"));
|
->selected(module::get_var("exif_gps", "sidebar_mapformat"));
|
||||||
$gps_sidebar->dropdown("sidebar_maptype")
|
$gps_sidebar->dropdown("sidebar_maptype")
|
||||||
|
@ -38,7 +38,19 @@ class exif_gps_block_Core {
|
|||||||
$block = new Block();
|
$block = new Block();
|
||||||
$block->css_id = "g-exif-gps-sidebar";
|
$block->css_id = "g-exif-gps-sidebar";
|
||||||
$block->title = t("Location");
|
$block->title = t("Location");
|
||||||
$block->content = new View("exif_gps_sidebar.html");
|
if (module::get_var("exif_gps", "sidebar_mapformat") == 1) {
|
||||||
|
$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";
|
||||||
|
} else {
|
||||||
|
$block->content = new View("exif_gps_static_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->latitude = $record->latitude;
|
$block->content->latitude = $record->latitude;
|
||||||
$block->content->longitude = $record->longitude;
|
$block->content->longitude = $record->longitude;
|
||||||
} elseif (module::is_active("tagsmap") && module::is_active("tag")) {
|
} elseif (module::is_active("tagsmap") && module::is_active("tag")) {
|
||||||
|
22
modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php
Normal file
22
modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<script type="text/javascript" src="http://www.google.com/jsapi?key=<?= module::get_var("exif_gps", "googlemap_api_key"); ?>"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
google.load("maps", "3",{"other_params":"sensor=false"});
|
||||||
|
function initialize() {
|
||||||
|
var latlng = new google.maps.LatLng(<?=$latitude; ?>,<?=$longitude; ?>);
|
||||||
|
var myOptions = {
|
||||||
|
zoom: <?= module::get_var("exif_gps", "sidebar_zoom"); ?>,
|
||||||
|
center: latlng,
|
||||||
|
mapTypeId: google.maps.MapTypeId.<?=$sidebar_map_type ?>
|
||||||
|
};
|
||||||
|
var map = new google.maps.Map(document.getElementById("sidebar_map_canvas"), myOptions);
|
||||||
|
var marker = new google.maps.Marker({
|
||||||
|
position: latlng,
|
||||||
|
map: map,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
google.setOnLoadCallback(initialize);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<div id="sidebar_map_canvas" style="width:205px; height:214px"></div>
|
@ -1,3 +0,0 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
|
||||||
<img src="http://maps.google.com/maps/api/staticmap?center=<?=$latitude; ?>,<?=$longitude; ?>&zoom=14&size=205x214&maptype=roadmap&markers=color:red|color:red|<?=$latitude; ?>,<?=$longitude; ?>&sensor=false">
|
|
||||||
|
|
3
modules/exif_gps/views/exif_gps_static_sidebar.html.php
Normal file
3
modules/exif_gps/views/exif_gps_static_sidebar.html.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<img src="http://maps.google.com/maps/api/staticmap?center=<?=$latitude; ?>,<?=$longitude; ?>&zoom=<?= module::get_var("exif_gps", "sidebar_zoom"); ?>&size=205x214&maptype=<?=$sidebar_map_type ?>&markers=color:red|color:red|<?=$latitude; ?>,<?=$longitude; ?>&sensor=false">
|
||||||
|
|
Reference in New Issue
Block a user