* Added: Authors can upload GPX tracks in a folder called as *your user name*, inside [../wp-upload dir/gpx/[*your user name*] (thanks to wildcomputations)
* Added: Authors an Admins can see the current values for shortcodes in help tab
* Added: Button to instant copy the shortcode of the selected GPX file in the tab track
* Added: different size logos for the plugin store (icon.svg, icon128x128.png and icon256x256.png) [inside ../plugins/wp-gpx-maps/assets]
* Changed: Settings tab is for non-Admin users is not more visible
* Tweak: Help tab is easier to read
* Tweak: Plugin is now complete translatable (Backend + Frontend)
* Tweak: WordPress coding standards
* Upgrade: Leaflet to 1.5.1
* Upgrade: leaflet.fullscreen to 1.4.5
* Upgrade: Chart.min.js to 2.8.0

Many thanks to Kniebremser for its help
This commit is contained in:
bastianonm 2019-06-18 07:09:56 +00:00
parent fd8b314a70
commit b684a1031e
52 changed files with 35275 additions and 18104 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,636 +0,0 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer {
max-width: none !important;
max-height: none !important;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
-o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 696 B

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 618 B

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,640 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,12 +0,0 @@
{
"browser": true,
"curly": true,
"eqeqeq": true,
"undef": true,
"quotmark": "single",
"trailing": true,
"globals": {
"L": true,
"jQuery": true
}
}

View File

@ -1,4 +0,0 @@
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
.leaflet-retina .leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }

View File

@ -1,164 +0,0 @@
(function() {
L.Control.FullScreen = L.Control.extend({
options: {
position: 'topleft',
title: 'Full Screen',
forceSeparateButton: false,
forcePseudoFullscreen: false
},
onAdd: function (map) {
var className = 'leaflet-control-zoom-fullscreen', container;
if (map.zoomControl && !this.options.forceSeparateButton) {
container = map.zoomControl._container;
} else {
container = L.DomUtil.create('div', 'leaflet-bar');
}
this._createButton(this.options.title, className, container, this.toggleFullScreen, this);
return container;
},
_createButton: function (title, className, container, fn, context) {
var link = L.DomUtil.create('a', className, container);
link.href = '#';
link.title = title;
L.DomEvent
.addListener(link, 'click', L.DomEvent.stopPropagation)
.addListener(link, 'click', L.DomEvent.preventDefault)
.addListener(link, 'click', fn, context);
L.DomEvent
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(container, fullScreenApi.fullScreenEventName, this._handleEscKey, context);
L.DomEvent
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context);
return link;
},
toggleFullScreen: function () {
var map = this._map;
map._exitFired = false;
if (map._isFullscreen) {
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
fullScreenApi.cancelFullScreen(map._container);
} else {
L.DomUtil.removeClass(map._container, 'leaflet-pseudo-fullscreen');
}
map.invalidateSize();
map.fire('exitFullscreen');
map._exitFired = true;
map._isFullscreen = false;
}
else {
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
fullScreenApi.requestFullScreen(map._container);
} else {
L.DomUtil.addClass(map._container, 'leaflet-pseudo-fullscreen');
}
map.invalidateSize();
map.fire('enterFullscreen');
map._isFullscreen = true;
}
},
_handleEscKey: function () {
var map = this._map;
if (!fullScreenApi.isFullScreen(map) && !map._exitFired) {
map.fire('exitFullscreen');
map._exitFired = true;
map._isFullscreen = false;
}
}
});
L.Map.addInitHook(function () {
if (this.options.fullscreenControl) {
this.fullscreenControl = L.control.fullscreen(this.options.fullscreenControlOptions);
this.addControl(this.fullscreenControl);
}
});
L.control.fullscreen = function (options) {
return new L.Control.FullScreen(options);
};
/*
Native FullScreen JavaScript API
-------------
Assumes Mozilla naming conventions instead of W3C for now
source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
*/
var
fullScreenApi = {
supportsFullScreen: false,
isFullScreen: function() { return false; },
requestFullScreen: function() {},
cancelFullScreen: function() {},
fullScreenEventName: '',
prefix: ''
},
browserPrefixes = 'webkit moz o ms khtml'.split(' ');
// check for native support
if (typeof document.exitFullscreen !== 'undefined') {
fullScreenApi.supportsFullScreen = true;
} else {
// check for fullscreen support by vendor prefix
for (var i = 0, il = browserPrefixes.length; i < il; i++ ) {
fullScreenApi.prefix = browserPrefixes[i];
if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] !== 'undefined' ) {
fullScreenApi.supportsFullScreen = true;
break;
}
}
}
// update methods to do something useful
if (fullScreenApi.supportsFullScreen) {
fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
fullScreenApi.isFullScreen = function() {
switch (this.prefix) {
case '':
return document.fullScreen;
case 'webkit':
return document.webkitIsFullScreen;
default:
return document[this.prefix + 'FullScreen'];
}
};
fullScreenApi.requestFullScreen = function(el) {
return (this.prefix === '') ? el.requestFullscreen() : el[this.prefix + 'RequestFullScreen']();
};
fullScreenApi.cancelFullScreen = function(el) {
return (this.prefix === '') ? document.exitFullscreen() : document[this.prefix + 'CancelFullScreen']();
};
}
// jQuery plugin
if (typeof jQuery !== 'undefined') {
jQuery.fn.requestFullScreen = function() {
return this.each(function() {
var el = jQuery(this);
if (fullScreenApi.supportsFullScreen) {
fullScreenApi.requestFullScreen(el);
}
});
};
}
// export api
window.fullScreenApi = fullScreenApi;
})();

View File

@ -1,22 +0,0 @@
Copyright (c) 2013, Bruno Bergot
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

View File

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Leaflet.Control.FullScreen Demo</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<style type="text/css">
#map { width: 700px; height: 433px; }
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
/* on selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
#map:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:-moz-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
</style>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="Control.FullScreen.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var base = new L.TileLayer('http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
});
var map = new L.Map('map', {
layers: [base],
center: new L.LatLng(48.5, -4.5),
zoom: 5,
fullscreenControl: true,
fullscreenControlOptions: { // optional
title:"Show me the fullscreen !"
}
});
// detect fullscreen toggling
map.on('enterFullscreen', function(){
if(window.console) window.console.log('enterFullscreen');
});
map.on('exitFullscreen', function(){
if(window.console) window.console.log('exitFullscreen');
});
</script>
</body>
</html>

View File

@ -0,0 +1,32 @@
{
"rules": {
"camelcase": 0,
"quotes": [2, "single", "avoid-escape"],
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"space-before-function-paren": 2,
"space-in-parens": 2,
"object-curly-spacing": [2, "never"],
"array-bracket-spacing": 2,
"computed-property-spacing": 2,
"space-before-blocks": 2,
"keyword-spacing": 2,
"no-lonely-if": 2,
"comma-style": 2,
"no-underscore-dangle": 0,
"no-constant-condition": 0,
"no-multi-spaces": 0,
"strict": 0,
"key-spacing": 0,
"no-shadow": 0,
"no-unused-vars": 2
},
"globals": {
"L": true,
"module": false,
"define": false,
"require": true
},
"env": {
"browser": true
}
}

View File

@ -0,0 +1,7 @@
{
"commitMessage": "version %s",
"tagName": "%s",
"scripts": {
"postcommit": "git push && git push --tags && npm publish"
}
}

View File

@ -0,0 +1,8 @@
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
.leaflet-retina .fullscreen-icon { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-container:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-container:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-container:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }

View File

@ -0,0 +1,202 @@
(function () {
L.Control.FullScreen = L.Control.extend({
options: {
position: 'topleft',
title: 'Full Screen',
titleCancel: 'Exit Full Screen',
forceSeparateButton: false,
forcePseudoFullscreen: false,
fullscreenElement: false
},
onAdd: function (map) {
var className = 'leaflet-control-zoom-fullscreen', container, content = '';
if (map.zoomControl && !this.options.forceSeparateButton) {
container = map.zoomControl._container;
} else {
container = L.DomUtil.create('div', 'leaflet-bar');
}
if (this.options.content) {
content = this.options.content;
} else {
className += ' fullscreen-icon';
}
this._createButton(this.options.title, className, content, container, this.toggleFullScreen, this);
this._map.on('enterFullscreen exitFullscreen', this._toggleTitle, this);
return container;
},
_createButton: function (title, className, content, container, fn, context) {
this.link = L.DomUtil.create('a', className, container);
this.link.href = '#';
this.link.title = title;
this.link.innerHTML = content;
L.DomEvent
.addListener(this.link, 'click', L.DomEvent.stopPropagation)
.addListener(this.link, 'click', L.DomEvent.preventDefault)
.addListener(this.link, 'click', fn, context);
L.DomEvent
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(container, fullScreenApi.fullScreenEventName, this._handleFullscreenChange, context);
L.DomEvent
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
.addListener(document, fullScreenApi.fullScreenEventName, this._handleFullscreenChange, context);
return this.link;
},
toggleFullScreen: function () {
var map = this._map;
map._exitFired = false;
if (map._isFullscreen) {
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
fullScreenApi.cancelFullScreen();
} else {
L.DomUtil.removeClass(this.options.fullscreenElement ? this.options.fullscreenElement : map._container, 'leaflet-pseudo-fullscreen');
}
map.fire('exitFullscreen');
map._exitFired = true;
map._isFullscreen = false;
}
else {
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
fullScreenApi.requestFullScreen(this.options.fullscreenElement ? this.options.fullscreenElement : map._container);
} else {
L.DomUtil.addClass(this.options.fullscreenElement ? this.options.fullscreenElement : map._container, 'leaflet-pseudo-fullscreen');
}
map.fire('enterFullscreen');
map._isFullscreen = true;
}
},
_toggleTitle: function () {
this.link.title = this._map._isFullscreen ? this.options.title : this.options.titleCancel;
},
_handleFullscreenChange: function () {
var map = this._map;
map.invalidateSize();
if (!fullScreenApi.isFullScreen() && !map._exitFired) {
map.fire('exitFullscreen');
map._exitFired = true;
map._isFullscreen = false;
}
}
});
L.Map.addInitHook(function () {
if (this.options.fullscreenControl) {
this.fullscreenControl = L.control.fullscreen(this.options.fullscreenControlOptions);
this.addControl(this.fullscreenControl);
}
});
L.control.fullscreen = function (options) {
return new L.Control.FullScreen(options);
};
/*
Native FullScreen JavaScript API
-------------
Assumes Mozilla naming conventions instead of W3C for now
source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
*/
var
fullScreenApi = {
supportsFullScreen: false,
isFullScreen: function () { return false; },
requestFullScreen: function () {},
cancelFullScreen: function () {},
fullScreenEventName: '',
prefix: ''
},
browserPrefixes = 'webkit moz o ms khtml'.split(' ');
// check for native support
if (typeof document.exitFullscreen !== 'undefined') {
fullScreenApi.supportsFullScreen = true;
} else {
// check for fullscreen support by vendor prefix
for (var i = 0, il = browserPrefixes.length; i < il; i++) {
fullScreenApi.prefix = browserPrefixes[i];
if (typeof document[fullScreenApi.prefix + 'CancelFullScreen'] !== 'undefined') {
fullScreenApi.supportsFullScreen = true;
break;
}
}
if (typeof document['msExitFullscreen'] !== 'undefined') {
fullScreenApi.prefix = 'ms';
fullScreenApi.supportsFullScreen = true;
}
}
// update methods to do something useful
if (fullScreenApi.supportsFullScreen) {
if (fullScreenApi.prefix === 'ms') {
fullScreenApi.fullScreenEventName = 'MSFullscreenChange';
} else {
fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
}
fullScreenApi.isFullScreen = function () {
switch (this.prefix) {
case '':
return document.fullscreen;
case 'webkit':
return document.webkitIsFullScreen;
case 'ms':
return document.msFullscreenElement;
default:
return document[this.prefix + 'FullScreen'];
}
};
fullScreenApi.requestFullScreen = function (el) {
switch (this.prefix) {
case '':
return el.requestFullscreen();
case 'ms':
return el.msRequestFullscreen();
default:
return el[this.prefix + 'RequestFullScreen']();
}
};
fullScreenApi.cancelFullScreen = function () {
switch (this.prefix) {
case '':
return document.exitFullscreen();
case 'ms':
return document.msExitFullscreen();
default:
return document[this.prefix + 'CancelFullScreen']();
}
};
}
// jQuery plugin
if (typeof jQuery !== 'undefined') {
jQuery.fn.requestFullScreen = function () {
return this.each(function () {
var el = jQuery(this);
if (fullScreenApi.supportsFullScreen) {
fullScreenApi.requestFullScreen(el);
}
});
};
}
// export api
window.fullScreenApi = fullScreenApi;
})();

View File

@ -0,0 +1,19 @@
Copyright (c) 2013, Bruno Bergot
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,68 +1,73 @@
Leaflet.Control.FullScreen Leaflet.Control.FullScreen
============ ============
What ? What ?
------ ------
Simple plugin for Leaflet that adds fullscreen button to your maps. Simple plugin for Leaflet that adds fullscreen button to your maps.
Inspired by http://elidupuis.github.com/leaflet.zoomfs/ Inspired by http://elidupuis.github.com/leaflet.zoomfs/
Use the native javascript fullscreen API http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ Use the native javascript fullscreen API http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
Released under the MIT License http://opensource.org/licenses/mit-license.php Released under the MIT License http://opensource.org/licenses/mit-license.php
How ? How ?
------ ------
Include Control.FullScreen.js and Control.FullScreen.css in your page: Include Control.FullScreen.js and Control.FullScreen.css in your page:
``` html ``` html
<link rel="stylesheet" href="Control.FullScreen.css" /> <link rel="stylesheet" href="Control.FullScreen.css" />
<script src="Control.FullScreen.js"></script> <script src="Control.FullScreen.js"></script>
``` ```
Add the fullscreen control to the map: Add the fullscreen control to the map:
``` js ``` js
var map = new L.Map('map', { var map = new L.Map('map', {
fullscreenControl: true, fullscreenControl: true,
fullscreenControlOptions: { fullscreenControlOptions: {
position: 'topleft' position: 'topleft'
} }
}); });
``` ```
If your map have a zoomControl the fullscreen button will be added at the bottom of this one. If your map have a zoomControl the fullscreen button will be added at the bottom of this one.
If your map doesn't have a zoomContron the fullscreen button will be added to topleft corner of the map (same as the zoomcontrol). If your map doesn't have a zoomContron the fullscreen button will be added to topleft corner of the map (same as the zoomcontrol).
__Events and options__: If you want to use the plugin on a map embedded in an iframe, don't forget to set `allowfullscreen` attribute on your iframe.
``` js __Events and options__:
// create a fullscreen button and add it to the map
L.control.fullscreen({ ``` js
position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft // create a fullscreen button and add it to the map
title: 'Show me the fullscreen !', // change the title of the button, default Full Screen L.control.fullscreen({
forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft
forcePseudoFullscreen: true // force use of pseudo full screen even if full screen API is available, default false title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
}).addTo(map); titleCancel: 'Exit fullscreen mode', // change the title of the button when fullscreen is on, default Exit Full Screen
content: null, // change the content of the button, can be HTML, default null
// events are fired when entering or exiting fullscreen. forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false
map.on('enterFullscreen', function(){ forcePseudoFullscreen: true, // force use of pseudo full screen even if full screen API is available, default false
console.log('entered fullscreen'); fullscreenElement: false // Dom element to render in full screen, false by default, fallback to map._container
}); }).addTo(map);
map.on('exitFullscreen', function(){ // events are fired when entering or exiting fullscreen.
console.log('exited fullscreen'); map.on('enterFullscreen', function(){
}); console.log('entered fullscreen');
``` });
Where ? map.on('exitFullscreen', function(){
------ console.log('exited fullscreen');
});
Source code : https://github.com/brunob/leaflet.fullscreen ```
Downloads : https://github.com/brunob/leaflet.fullscreen/releases Where ?
------
Demo : http://brunob.github.com/leaflet.fullscreen/
Source code : https://github.com/brunob/leaflet.fullscreen
Downloads : https://github.com/brunob/leaflet.fullscreen/releases
Demo : http://brunob.github.com/leaflet.fullscreen/

View File

@ -1,30 +1,33 @@
{ {
"name": "leaflet.fullscreen", "name": "leaflet.fullscreen",
"version": "1.1.4", "version": "1.4.5",
"homepage": "https://github.com/brunob/leaflet.fullscreen", "homepage": "https://github.com/brunob/leaflet.fullscreen",
"authors": [ "license": "MIT",
"brunob <brunobergot@gmail.com>" "authors": [
], "brunob <brunobergot@gmail.com>"
"description": "Leaflet.Control.FullScreen for Leaflet", ],
"main": [ "description": "Leaflet.Control.FullScreen for Leaflet",
"Control.FullScreen.js", "main": [
"Control.FullScreen.css", "Control.FullScreen.js",
"icon-fullscreen.png", "Control.FullScreen.css",
"icon-fullscreen-2x.png" "icon-fullscreen.png",
], "icon-fullscreen-2x.png"
"keywords": [ ],
"leaflet", "devDependencies": {
"plugins", "eslint": "2.3.0"
"maps", },
"fullscreen" "keywords": [
], "leaflet",
"license": "MIT", "plugins",
"ignore": [ "maps",
"**/.*", "fullscreen"
"node_modules", ],
"bower_components", "ignore": [
"test", "**/.*",
"tests", "node_modules",
"index.html" "bower_components",
] "test",
} "tests",
"index.html"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Leaflet.Control.FullScreen Demo</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />
<style type="text/css">
#map { width: 700px; height: 433px; }
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
#map:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
#map:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
</style>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<script src="Control.FullScreen.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var base = new L.TileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
maxZoom: 19,
subdomains: 'abcd',
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
});
var map = new L.Map('map', {
layers: [base],
center: new L.LatLng(48.5, -4.5),
zoom: 5,
fullscreenControl: true,
fullscreenControlOptions: { // optional
title:"Show me the fullscreen !",
titleCancel:"Exit fullscreen mode"
}
});
// detect fullscreen toggling
map.on('enterFullscreen', function(){
if(window.console) window.console.log('enterFullscreen');
});
map.on('exitFullscreen', function(){
if(window.console) window.console.log('exitFullscreen');
});
</script>
</body>
</html>

View File

@ -1,25 +1,25 @@
{ {
"name": "leaflet.fullscreen", "name": "leaflet.fullscreen",
"version": "1.1.4", "version": "1.4.5",
"description": "Simple plugin for Leaflet that adds fullscreen button to your maps.", "description": "Simple plugin for Leaflet that adds fullscreen button to your maps.",
"main": "Control.FullScreen.js", "main": "Control.FullScreen.js",
"scripts": { "scripts": {
"test": "jshint Control.FullScreen.js" "test": "eslint --config .eslintrc Control.FullScreen.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/brunob/leaflet.fullscreen.git" "url": "git://github.com/brunob/leaflet.fullscreen.git"
}, },
"keywords": [ "keywords": [
"leaflet", "leaflet",
"plugins", "plugins",
"maps", "maps",
"fullscreen" "fullscreen"
], ],
"devDependencies": { "devDependencies": {
"jshint": "2.5.0" "eslint": "2.3.0"
}, },
"author": "b_b", "author": "b_b",
"license": "MIT License", "license": "MIT License",
"readmeFilename": "README.md" "readmeFilename": "README.md"
} }

BIN
assets/icon-128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
assets/icon-256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

1
assets/icon.svg Normal file
View File

@ -0,0 +1 @@
<svg height="512pt" viewBox="0 0 512 512" width="512pt" xmlns="http://www.w3.org/2000/svg"><path d="m452 122c-27.601562 0-50 22.402344-50 50v280h100v-280c0-27.609375-22.390625-50-50-50zm0 0" fill="#ececf1"/><path d="m60 122c-27.601562 0-50 22.402344-50 50v280h100c0-10.460938 0-266.328125 0-280 0-27.609375-22.390625-50-50-50zm0 0" fill="#ececf1"/><path d="m260 322h142c0-54.882812 0-108.527344 0-120h-268s91.441406 87.089844 126 120zm0 0" fill="#7fe881"/><path d="m110 262v190c0-27.609375-22.390625-50-50-50s-50 22.390625-50 50c0 29.078125 25.246094 50 52.851562 50h47.148438l126-120zm0 0" fill="#76e2f8"/><path d="m465.320312 403.71875c-33.359374-8.617188-63.320312 16.332031-63.320312 48.28125 0-7.824219 0-35.589844 0-70h-86l-120 120h256c27.621094 0 50-22.378906 50-50 0-24.109375-16.308594-43.019531-36.679688-48.28125zm0 0" fill="#76e2f8"/><path d="m402 322v60h-86l-120 120h-86l126-120-126-120v-60h24s91.441406 87.089844 126 120zm0 0" fill="#fed2a4"/><path d="m256 10c49.710938 0 90 40.289062 90 90 0 24.488281-21.828125 66.089844-43.988281 102-22.832031 37.019531-46.011719 68-46.011719 68s-23.179688-30.980469-46.011719-68c-22.160156-35.910156-43.988281-77.511719-43.988281-102 0-49.710938 40.289062-90 90-90zm0 0" fill="#ff637b"/><path d="m256 60c22.058594 0 40 17.941406 40 40s-17.941406 40-40 40-40-17.941406-40-40 17.941406-40 40-40zm0 0" fill="#ececf1"/><path d="m452 112c-33.144531 0-60 26.847656-60 60v20h-72.3125c24.097656-41.210938 36.3125-72.117188 36.3125-92 0-55.140625-44.859375-100-100-100s-100 44.859375-100 100c0 19.882812 12.214844 50.792969 36.3125 92-8.117188 0-65.292969 0-72.3125 0v-20c0-33.085938-26.914062-60-60-60-33.144531 0-60 26.847656-60 60v56c0 5.523438 4.476562 10 10 10s10-4.476562 10-10v-56c0-22.09375 17.902344-40 40-40 22.054688 0 40 17.945312 40 40v235.316406c-10.621094-9.519531-24.648438-15.316406-40-15.316406-15.355469 0-29.375 5.804688-40 15.328125v-99.328125c0-5.523438-4.476562-10-10-10s-10 4.476562-10 10v144c0 34.308594 29.617188 60 62.851562 60h389.148438c33.085938 0 60-26.914062 60-60v-280c0-33.085938-26.914062-60-60-60zm-40 60c0-22.09375 17.902344-40 40-40 22.054688 0 40 17.945312 40 40v235.042969c-6.875-6.121094-15.152344-10.675781-24.179688-13.003907-20.042968-5.183593-40.664062-.304687-55.820312 13.230469 0-8.550781 0-223.265625 0-235.269531zm-20 140h-128c-33.511719-31.910156-97.515625-92.871094-104.996094-100h45.429688c21.832031 34.875 43.335937 63.691406 43.558594 63.992188 1.890624 2.523437 4.855468 4.007812 8.007812 4.007812s6.117188-1.484375 8.007812-4.007812c.222657-.300782 21.730469-29.117188 43.558594-63.992188h84.433594zm-136-292c44.113281 0 80 35.886719 80 80 0 37.128906-58.570312 122.988281-80 152.988281-21.765625-30.476562-80-116.199219-80-152.988281 0-44.113281 35.886719-80 80-80zm-236 432c0-22.054688 17.945312-40 40-40s40 17.945312 40 40c0 5.523438 4.476562 10 10 10s10-4.476562 10-10v-166.667969l101.5 96.667969-115.5 110h-43.148438c-22.425781 0-42.851562-16.761719-42.851562-40zm222.894531-62.757812c1.984375-1.890626 3.105469-4.507813 3.105469-7.242188s-1.121094-5.355469-3.105469-7.242188l-122.894531-117.042968v-45.714844h10c.683594.652344 118.339844 112.707031 123.105469 117.242188 1.859375 1.769531 4.328125 2.757812 6.894531 2.757812h132v40h-76c-2.652344 0-5.195312 1.054688-7.070312 2.929688l-117.074219 117.070312h-56.855469zm209.105469 102.757812h-231.855469l100-100h71.855469v60c0 5.523438 4.476562 10 10 10s10-4.476562 10-10c0-25.863281 24.21875-45.46875 50.820312-38.597656 16.238282 4.195312 29.179688 19.191406 29.179688 38.597656 0 22.054688-17.945312 40-40 40zm0 0"/><path d="m256 150c27.570312 0 50-22.429688 50-50s-22.429688-50-50-50-50 22.429688-50 50 22.429688 50 50 50zm0-80c16.542969 0 30 13.457031 30 30s-13.457031 30-30 30-30-13.457031-30-30 13.457031-30 30-30zm0 0"/><path d="m10 278c5.519531 0 10-4.480469 10-10s-4.480469-10-10-10-10 4.480469-10 10 4.480469 10 10 10zm0 0"/></svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

62
css/admin-style.css Normal file
View File

@ -0,0 +1,62 @@
/**
* This file contains the style definitions for the admin area
*
* Content:
* --------
* 1. Over the Tabs
* 2. Tab: Tracks
* 3. Tab: Settings
* 4. Tab: Help
*/
/**
* 1.0 Over the Tabs
*/
/**
* 2.0 Tab: Tracks
*/
/**
* 3.0 Tab: Settings
*/
.wpgpxmaps-container-tab-settings {
display: block;
padding: 5px 20px 1px 20px;
}
/**
* 4.0 Tab: Tracks
*/
.wpgpxmaps-container-tab-faq {
display: block;
padding: 5px 20px 1px 20px;
}
.wpgpxmaps-tab-faq {
display: block;
padding: 5px 20px 10px 20px;
}
.wpgpxmaps-container-tab-faq table.widefat {
margin-bottom: 10px;
border-bottom: none;
border-radius: 6px;
}
.wpgpxmaps-container-tab-faq table.widefat tbody tr:hover {
background:#eeeeee;
}
.wpgpxmaps-container-tab-faq table.widefat th,
.wpgpxmaps-container-tab-faq table.widefat td {
padding: 4px 10px;
}
.wpgpxmaps-container-tab-faq table.widefat thead tr th {
font-size: 14px;
}
.wpgpxmaps-container-tab-faq table.widefat td {
width: 200px;
}

17
js/Chart.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +1,54 @@
=== WP GPX Maps === === WP GPX Maps ===
Contributors: bastianonm, Stephan Klein, Michel Selerin Contributors: bastianonm, Stephan Klein, Michel Selerin, TosattoSimonePio, Kniebremser
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VHWLRW6JBTML Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VHWLRW6JBTML
Tags: maps, gpx, gps, graph, chart, leaflet, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence Tags: maps, gpx, gps, graph, chart, leaflet, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence
Requires at least: 2.0.0 Requires at least: 4.6.0
Tested up to: 4.9.8 Tested up to: 5.2.1
Stable tag: 1.6.07 Stable tag: 1.7.00
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. Draws a GPX track with altitude graph. You can also display your nextgen gallery images in the map.
== Description == == Description ==
This plugin has, as input, the GPX file with the track you've made and as output it shows the map of the track and an interactive altitude graph (where available). This plugin has, as input, the GPX file with the track you've made and as output it shows the map of the track and an interactive altitude graph (where available).
Now on github: https://github.com/devfarm-it/wp-gpx-maps Fully configurable:
On github you can contribuite easly with your code
Fully configurable:
- Custom colors - Custom colors
- Custom icons - Custom icons
- Multiple language support - Multiple language support
Supported charts: Supported charts:
- Altitude - Altitude
- Speed - Speed
- Heart Rate - Heart rate
- Temperature - Temperature
- Cadence - Cadence
- Grade - Grade
NextGen Gallery Integration: NextGen Gallery Integration:
Display your NextGen Gallery images inside the map! Display your NextGen Gallery images inside the map!
Even if you don't have a gps camera, this plugin can retrive the image position starting from the image date and you gpx file. Even if you don't have a GPS camera, this plugin can retrive the image position starting from the image date and your GPX file.
Post Attachments Integration: Post Attachments Integration:
This version is extended by Stephan Klein (https://klein-gedruckt.de/2015/03/wordpress-plugin-wp-gpx-maps/) and supports displaying all images attached to a post without using NGG. This version is extended by: <a href="https://klein-gedruckt.de/2015/03/wordpress-plugin-wp-gpx-maps/" target="_blank" rel="noopener noreferrer">Stephan Klein</a> and supports displaying all images attached to a post without using NGG.
Translated into 14 languages: Try this plugin: <a href="https://devfarm.it/wp-gpx-maps-demo/" target="_blank" rel="noopener noreferrer">https://devfarm.it/wp-gpx-maps-demo/</a>
Support:
If you need help, please use: <a href="http://www.devfarm.it/forums/forum/wp-gpx-maps/" target="_blank" rel="noopener noreferrer">www.devfarm.it Support Forum</a>
Would you like to help fix bugs or further develop the plugin? On <a href="https://github.com/devfarm-it/wp-gpx-maps" target="_blank" rel="noopener noreferrer">Github</a> you can contribuite easly with your code.
Translations:
Translators are welcome to contribute to the plugin. Please use the <a href="https://translate.wordpress.org/projects/wp-plugins/wp-gpx-maps/)" target="_blank" rel="noopener noreferrer">WordPress translation website</a>.
The language files in the plugin contain 19 translatable texts for 14 languages:
- Catalan ca - Catalan ca
- Dutch nl_NL - Dutch nl_NL
@ -60,25 +69,28 @@ Translated into 14 languages:
- Norwegian nb_NO - Norwegian nb_NO
- Japanese ja_JP - Japanese ja_JP
(many thanks to all guys who helped me with the translations) (Many thanks to all guys who helped me with the translations)
- iphone/ipad/ipod Compatible Currently are 222 texts are translatable in the plugin.
Try this plugin: <a href="https://devfarm.it/wp-gpx-maps-demo/">https://devfarm.it/wp-gpx-maps-demo/</a> With your help, the plugin can be translated into any language. For updating the language file you no longer need to wait for a new version of the plugin.
Are 95% WordPress generates a new language file for your language.
If the translation is available via WP Translate, the language file will be deleted in the next version of the plugin.
Please also help with the translation of the readme. The more languages that are available, the wider the spread of the plugin will be.
<a href="http://www.devfarm.it/forums/forum/wp-gpx-maps/">Support Forum</a> Supported GPX namespaces are:
Supported gpx namespaces are:
1. http://www.topografix.com/GPX/1/0 1. http://www.topografix.com/GPX/1/0
1. http://www.topografix.com/GPX/1/1 1. <a href="http://www.topografix.com/GPX/1/1" target="_blank" rel="noopener noreferrer">www.topografix.com/GPX/1/1</a>
1. http://www.garmin.com/xmlschemas/GpxExtensions/v3 1. http://www.garmin.com/xmlschemas/GpxExtensions/v3
1. http://www.garmin.com/xmlschemas/TrackPointExtension/v1 1. http://www.garmin.com/xmlschemas/TrackPointExtension/v1
Thanks to: <a href="http://www.securcube.net/">www.securcube.net</a>, <a href="http://www.devfarm.it/">www.devfarm.it</a> Thanks to: <a href="http://www.securcube.net/" target="_blank" rel="noopener noreferrer">www.securcube.net</a>, <a href="http://www.devfarm.it/" target="_blank" rel="noopener noreferrer">www.devfarm.it</a>
Icons made by <a href="https://www.freepik.com/" target="_blank" rel="noopener noreferrer">Freepik</a> from <a href="https://www.flaticon.com/" target="_blank" rel="noopener noreferrer">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" target="_blank" rel="noopener noreferrer">Creative Commons BY 3.0</a>
== Installation == == Installation ==
@ -90,58 +102,63 @@ Thanks to: <a href="http://www.securcube.net/">www.securcube.net</a>, <a href="h
== Frequently Asked Questions == == Frequently Asked Questions ==
= what are all available shortcode attributes? = = Which shortcode attributes are available? =
The attributes are: You can use the following shortcodes:
1. gpx: relative path to gpx 1. gpx: Relative path to the GPX file
1. width: width in pixels 1. width: Width in pixels
1. mheight: map height 1. mheight: Map height
1. gheight: graph height 1. gheight: Graph height
1. mtype: map available types are: HYBRID, ROADMAP, SATELLITE, TERRAIN, OSM1 (Open Street Map), OSM2 (Open Cycle Map), OSM3 (Hike & Bike), OSM4 (Open Cycle Map - Transport), OSM5 (Open Cycle Map - Landscape), OSM6 (MapToolKit - Terrain) 1. skipcache: Do not use cache. If TRUE might be very slow (default is false)
1. waypoints: print the gpx waypoints inside the map (default is FALSE) 1. download: Allow users to download your GPX file (default is false)
1. donotreducegpx: print all the point without reduce it (default is FALSE) 1. summary: Print summary details of your GPX track (default is false)
1. pointsoffset: skip points closer than XX meters(default is 10) 1. summarytotlen: Print total distance in summary table (default is false)
1. uom: distance/altitude possible unit of measure are: 0, 1, 2, 3, 4, 5 (0 = meters, 1 = feet/miles, 2 = meters/kilometers, 3 = meters/nautical miles, 4 = meters/miles, 5 = feet/nautical miles) 1. summarymaxele: Print max elevation in summary table (default is false)
1. mlinecolor: map line color (default is #3366cc) 1. summaryminele: Print min Elevation in summary table (default is false)
1. glinecolor: altitude line color (default is #3366cc) 1. summaryeleup: Print total climbing in summary table (default is false)
1. showspeed: show speed inside the chart (default is FALSE) 1. summaryeledown: Print total descent in summary table (default is false)
1. showhr: show heart rate inside the chart (default is FALSE) 1. summaryavgspeed: Print average Speed in summary table (default is false)
1. showele: show elevation data inside the chart (default is TRUE) 1. summarytotaltime: Print total time in summary table (default is false)
1. showcad: show cadence inside the chart (default is FALSE) 1. mtype: Map available types are: HYBRID, ROADMAP, SATELLITE, TERRAIN, OSM1 (Open Street Map), OSM2 (Open Cycle Map), OSM4 (Open Cycle Map - Transport), OSM5 (Open Cycle Map - Landscape), OSM6 (MapToolKit - Terrain), OSM7 (Open Street Map - Humanitarian map style), OSM 9 (Hike & Bike), OSM10 (Open Sea Map)
1. showgrade: show grade inside the chart (default is FALSE) 1. mlinecolor: Map line color (default is #3366cc)
1. glinecolorspeed: speed line color (default is #ff0000) 1. zoomonscrollwheel: Zoom on map when mouse scroll wheel (default is false)
1. glinecolorhr: heart rate line color (default is #ff77bd) 1. waypoints: Print the gpx waypoints inside the map (default is false)
1. glinecolorcad: cadence line color (default is #beecff)
1. glinecolorgrade: grade line color (default is #beecff)
1. uomspeed: unit of measure for speed are: 0, 1, 2, 3, 4, 5 (0 = m/s, 1 = km/h, 2 = miles/h, 3 = min/km, 4 = min/miles, 5 = Nautical Miles/Hour (Knots))
1. chartFrom1: minimun value for altitude chart
1. chartTo1: maxumin value for altitude chart
1. chartFrom2: minimun value for speed chart
1. chartTo2: maxumin value for speed chart
1. startIcon: Start track icon 1. startIcon: Start track icon
1. endIcon: End track icon 1. endIcon: End track icon
1. currentIcon: Current position icon (when mouse hover) 1. currentIcon: Current position icon (when mouse hover)
1. waypointicon: waypoint custom icon 1. waypointicon: Waypoint custom icon
1. showele: Show elevation data inside the chart (default is true)
1. uom: Distance/altitude possible unit of measure (0 = meters, 1 = feet/miles, 2 = meters/kilometers, 3 = meters/nautical miles, 4 = meters/miles, 5 = feet/nautical miles)
1. glinecolor: Altitude line color (default is #3366cc)
1. chartFrom1: Minimun value for altitude chart
1. chartTo1: Maxumin value for altitude chart
1. showspeed: Show speed inside the chart (default is false)
1. glinecolorspeed: Speed line color (default is #ff0000)
1. uomspeed: Unit of measure for speed (0 = m/s, 1 = km/h, 2 = miles/h, 3 = min/km, 4 = min/miles, 5 = Nautical Miles/Hour (Knots), 6 = min/100 meters)
1. chartFrom2: Minimun value for speed chart
1. chartTo2: Maxumin value for speed chart
1. showhr: Show heart rate inside the chart (default is false)
1. glinecolorhr: Heart rate line color (default is #ff77bd)
1. showatemp: Show temperature inside the chart (default is false)
1. glinecoloratemp: Temperature line color (default is #ff77bd)
1. showcad: Show cadence inside the chart (default is false)
1. glinecolorcad: Cadence line color (default is #beecff)
1. showgrade: Show grade inside the chart (default is false)
1. glinecolorgrade: Grade line color (default is #beecff)
1. nggalleries: NextGen Gallery id or a list of Galleries id separated by a comma 1. nggalleries: NextGen Gallery id or a list of Galleries id separated by a comma
1. ngimages: NextGen Image id or a list of Images id separated by a comma 1. ngimages: NextGen Image id or a list of Images id separated by a comma
1. dtoffset: the difference (in seconds) between your gpx tool date and your camera date 1. attachments: Show all images that are attached to post (default is false)
1. zoomonscrollwheel: zoom on map when mouse scroll wheel 1. dtoffset: The difference (in seconds) between your gpx tool date and your camera date
1. download: Allow users to download your GPX file 1. pointsoffset: Skip points closer than XX meters (default is 10)
1. skipcache: Do not use cache. If TRUE might be very slow (default is FALSE) 1. donotreducegpx: Print all the point without reduce it (default is false)
1. summary: Print summary details of your GPX (default is FALSE)
1. summarytotlen: Print Total distance in summary table (default is FALSE) = What happening if I've a very large GPX files? =
1. summarymaxele: Print Max Elevation in summary table (default is FALSE)
1. summaryminele: Print Min Elevation in summary table (default is FALSE)
1. summaryeleup: Print Total climbing in summary table (default is FALSE)
1. summaryeledown: Print Total descent in summary table (default is FALSE)
1. summaryavgspeed: Print Average Speed in summary table (default is FALSE)
1. summarytotaltime: Print Total time in summary table (default is FALSE)
= What happening if I've a very large gpx? =
This plugin will print a small amout of points to speedup javascript and pageload. This plugin will print a small amout of points to speedup javascript and pageload.
= Is it free? = = Is it free? =
Yes! Yes!
== Screenshots == == Screenshots ==
@ -150,19 +167,32 @@ Yes!
1. Admin area - List of tracks 1. Admin area - List of tracks
1. Admin area - Settings 1. Admin area - Settings
1. Altitude & Speed 1. Altitude & Speed
1. Altitude & Speed & Hearth rate 1. Altitude & Speed & Heart rate
== Changelog == == Changelog ==
= 1.6.07 =
= 1.7.00 =
* Added: Authors can upload GPX tracks in a folder called as *your user name*, inside [../wp-upload dir/gpx/[*your user name*] (thanks to wildcomputations)
* Added: Authors an Admins can see the current values for shortcodes in help tab
* Added: Button to instant copy the shortcode of the selected GPX file in the tab track
* Added: different size logos for the plugin store (icon.svg, icon128x128.png and icon256x256.png) [inside ../plugins/wp-gpx-maps/assets]
* Changed: Settings tab is for non-Admin users is not more visible
* Tweak: Help tab is easier to read
* Tweak: Plugin is now complete translatable (Backend + Frontend)
* Tweak: WordPress coding standards
* Upgrade: Leaflet to 1.5.1
* Upgrade: leaflet.fullscreen to 1.4.5
* Upgrade: Chart.min.js to 2.8.0
= 1.6.07 =
* resolve admin error * resolve admin error
= 1.6.06 = = 1.6.06 =
* Added average values under the graph (thanks to cyclinggeorgian) * Added average values under the graph (thanks to cyclinggeorgian)
= 1.6.04 = = 1.6.04 =
* NGG gallery is working * NGG gallery is working
* Getting HR, Cad and Temp working again (thanks to cyclinggeorgian) * Getting HR, Cad and Temp working again (thanks to cyclinggeorgian)
* Fix javascript errors * Fix javascript errors
* Fix multiple traks gpx * Fix multiple traks gpx
= 1.6.03 = = 1.6.03 =
* Fix syntax error causing graph not to display (thanks to nickstabler) * Fix syntax error causing graph not to display (thanks to nickstabler)
= 1.6.02 = = 1.6.02 =
* Resolved errors with start and end icons * Resolved errors with start and end icons
@ -188,8 +218,8 @@ Yes!
= 1.5.00 = = 1.5.00 =
* replaced highcharts with chartjs. This is a forced choice due highcharts license issue, view: https://devfarm.it/wordpress-plugin/wordpress-plugin-directory-notice-wp-gpx-maps-temporarily-disabled/ * replaced highcharts with chartjs. This is a forced choice due highcharts license issue, view: https://devfarm.it/wordpress-plugin/wordpress-plugin-directory-notice-wp-gpx-maps-temporarily-disabled/
= 1.3.16 = = 1.3.16 =
* Added Norwegian nb_NO translation (thanks to thordivel) * Added Norwegian nb_NO translation (thanks to thordivel)
* Added Japanese ja_JP translation (thanks to dentos) * Added Japanese ja_JP translation (thanks to dentos)
= 1.3.15 = = 1.3.15 =
* Switched to HTTPS where possible (thanks to delitestudio) * Switched to HTTPS where possible (thanks to delitestudio)
= 1.3.14 = = 1.3.14 =
@ -245,7 +275,7 @@ Yes!
= 1.2.2 = = 1.2.2 =
* Smaller map type selector * Smaller map type selector
* New map: MapToolKit - Terrain * New map: MapToolKit - Terrain
* Fix: Google maps exception for NextGen Gallery * Fix: Google maps exception for NextGen Gallery
= 1.2.1 = = 1.2.1 =
* Fix: NextGen Gallery 1.9 compatibility * Fix: NextGen Gallery 1.9 compatibility
= 1.2.0 = = 1.2.0 =
@ -267,11 +297,11 @@ Yes!
* qTranslate compatible * qTranslate compatible
= 1.1.41 = = 1.1.41 =
* Added Polish translation, thanks to Sebastian * Added Polish translation, thanks to Sebastian
* Fix: Spanish translation * Fix: Spanish translation
* Minor javascript improvement * Minor javascript improvement
= 1.1.40 = = 1.1.40 =
* Improved italian translation * Improved italian translation
* Added grade chart (beta) * Added grade chart (beta)
= 1.1.39 = = 1.1.39 =
* Added French translation, thanks to Hervé * Added French translation, thanks to Hervé
* Added Nautical Miles per Hour (Knots) unit of measure * Added Nautical Miles per Hour (Knots) unit of measure
@ -284,7 +314,7 @@ Yes!
= 1.1.35 = = 1.1.35 =
* Fix: In the post list, sometime, the maps was not displaying correctly ( the php rand() function was not working?? ) * Fix: In the post list, sometime, the maps was not displaying correctly ( the php rand() function was not working?? )
* Various improvements for multi track gpx. Thanks to GPSracks.tv * Various improvements for multi track gpx. Thanks to GPSracks.tv
* Summary table is now avaiable even without chart. Thanks to David * Summary table is now avaiable even without chart. Thanks to David
= 1.1.34 = = 1.1.34 =
* 2 decimals for unit of measure min/km and min/mi * 2 decimals for unit of measure min/km and min/mi
* translation file updated (a couple of phrases added) * translation file updated (a couple of phrases added)
@ -292,7 +322,7 @@ Yes!
* nggallery integration: division by zero fixed * nggallery integration: division by zero fixed
= 1.1.33 = = 1.1.33 =
* Decimals reducted to 1 for unit of measure min/km and min/mi * Decimals reducted to 1 for unit of measure min/km and min/mi
* map zoom and center position is working with waypoints only files * map zoom and center position is working with waypoints only files
* automatic scale works again (thanks to MArkus) * automatic scale works again (thanks to MArkus)
= 1.1.32 = = 1.1.32 =
* You can exclude cache (slower and not recommended) * You can exclude cache (slower and not recommended)
@ -328,12 +358,12 @@ Yes!
* upgrade to google maps 3.9 * upgrade to google maps 3.9
= 1.1.20 = = 1.1.20 =
* google maps images fixed in <a href="http://wordpress.org/extend/themes/yoko">Yoko theme</a> * google maps images fixed in <a href="http://wordpress.org/extend/themes/yoko">Yoko theme</a>
= 1.1.19 = = 1.1.19 =
* include jQuery if needed * include jQuery if needed
= 1.1.17 = = 1.1.17 =
* Remove zero values from cadence and heart rate charts * Remove zero values from cadence and heart rate charts
* nextgen gallery improvement * nextgen gallery improvement
= 1.1.16 = = 1.1.16 =
* Cadence chart (where available) * Cadence chart (where available)
* minor bug fixes * minor bug fixes
= 1.1.15 = = 1.1.15 =
@ -343,7 +373,7 @@ Yes!
* added css to avoid map bars display issue * added css to avoid map bars display issue
= 1.1.13 = = 1.1.13 =
* added new types of maps: Open Street Map, Open Cycle Map, Hike & Bike. * added new types of maps: Open Street Map, Open Cycle Map, Hike & Bike.
* fixed nextgen gallery caching problem * fixed nextgen gallery caching problem
= 1.1.12 = = 1.1.12 =
* nextgen gallery display bug fixes * nextgen gallery display bug fixes

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,9 @@
if ( is_admin() ){ if ( is_admin() ) {
add_action('admin_menu', 'wpgpxmaps_admin_menu'); add_action( 'admin_menu', 'wpgpxmaps_admin_menu' );
} }
@ -12,15 +12,28 @@ if ( is_admin() ){
function wpgpxmaps_admin_menu() { function wpgpxmaps_admin_menu() {
if ( current_user_can('manage_options') ){ /*
add_options_page('WP GPX Maps', 'WP GPX Maps', 'manage_options', 'WP-GPX-Maps', 'WP_GPX_Maps_html_page'); All roles/capabilities:
} https://wordpress.org/support/article/roles-and-capabilities/
else if ( current_user_can('publish_posts') ) { */
add_menu_page('WP GPX Maps', 'WP GPX Maps', 'publish_posts', 'WP-GPX-Maps', 'WP_GPX_Maps_html_page'); if ( current_user_can( 'manage_options' ) ) {
/* Only Administrators and Super Administrators */
add_options_page( 'WP GPX Maps', 'WP GPX Maps', 'manage_options', 'WP-GPX-Maps', 'WP_GPX_Maps_html_page' );
}
elseif ( current_user_can( 'publish_posts' ) ) {
/* Contributor Authors and */
$allow_users_upload = get_option( 'wpgpxmaps_allow_users_view' ) === "true";
if ($allow_users_upload == 1)
{
add_menu_page( 'WP GPX Maps', 'WP GPX Maps', 'publish_posts', 'WP-GPX-Maps', 'WP_GPX_Maps_html_page' );
}
} }
@ -30,35 +43,32 @@ function wpgpxmaps_admin_menu() {
function wpgpxmaps_ilc_admin_tabs( $current ) { function wpgpxmaps_ilc_admin_tabs( $current ) {
if ( current_user_can( 'manage_options' ) ) {
$tabs = array(
'tracks' => __( 'Tracks', 'wp-gpx-maps' ),
'settings' => __( 'Settings', 'wp-gpx-maps' ),
'help' => __( 'Help', 'wp-gpx-maps' ),
);
} elseif ( current_user_can( 'publish_posts' ) ) {
if (current_user_can('manage_options')) $tabs = array(
'tracks' => __( 'Tracks', 'wp-gpx-maps' ),
'help' => __( 'Help', 'wp-gpx-maps' ),
);
}
{ echo '<h2 class="nav-tab-wrapper">';
$tabs = array( 'tracks' => 'Tracks', 'settings' => 'Settings', 'help' => "help" ); foreach ( $tabs as $tab => $name ) {
$class = ( $tab == $current ) ? ' nav-tab-active' : '';
echo "<a class='nav-tab$class' href='?page=WP-GPX-Maps&tab=$tab'>$name</a>";
} }
else if ( current_user_can('publish_posts') ) { echo '</h2>';
$tabs = array( 'tracks' => 'Tracks', 'help' => "help" );
}
echo '<h2 class="nav-tab-wrapper">';
foreach( $tabs as $tab => $name ){
$class = ( $tab == $current ) ? ' nav-tab-active' : '';
echo "<a class='nav-tab$class' href='?page=WP-GPX-Maps&tab=$tab'>$name</a>";
}
echo '</h2>';
} }
@ -72,252 +82,72 @@ function WP_GPX_Maps_html_page() {
$relativeGpxPath = relativeGpxFolderPath(); $relativeGpxPath = relativeGpxFolderPath();
$relativeGpxPath = str_replace("\\","/", $relativeGpxPath); $relativeGpxPath = str_replace( "\\","/", $relativeGpxPath );
$relativeGpxCachePath = relativeGpxCacheFolderPath();
$relativeGpxCachePath = str_replace( "\\","/", $relativeGpxCachePath );
$tab = $_GET['tab']; $tab = $_GET['tab'];
if ($tab == '') if ( $tab == '' )
$tab = 'tracks'; $tab = 'tracks';
?>
?>
<div id="icon-themes" class="icon32"><br></div> <div id="icon-themes" class="icon32"><br></div>
<h2>WP GPX Settings</h2> <h2><?php _e( 'Settings', 'wp-gpx-maps' ); ?></h2>
<?php <?php
if ( file_exists( $realGpxPath ) && is_dir( $realGpxPath ) ) {
/* Directory exist! */
if(file_exists($realGpxPath) && is_dir($realGpxPath)) } else {
{
//dir exsist!
}
else
{
if (!@mkdir($realGpxPath,0755,true)) {
echo '<div class="error" style="padding:10px">
Can\'t create <b>'.$realGpxPath.'</b> folder. Please create it and make it writable!<br />
If not, you will must update the file manually!
</div>';
if ( ! @mkdir( $realGpxPath, 0755, true ) ) {
echo '<div class=" notice notice-error"><p>';
printf(
/* translators: Relative path of the GPX folder */
__( 'Can not create the folder %1s for GPX files. Please create the folder and make it writable! If not, you will must update the files manually!', 'wp-gpx-maps' ),
'<span class="code"><strong>' . esc_html( $relativeGpxPath ) . '</strong></span>'
);
echo '</p></div>';
} }
} }
if ( file_exists( $cacheGpxPath ) && is_dir( $cacheGpxPath ) ) {
if(file_exists($cacheGpxPath) && is_dir($cacheGpxPath)) /* Directory exist! */
{ } else {
//dir exsist!
}
else
{
if (!@mkdir($cacheGpxPath,0755,true)) {
echo '<div class="error" style="padding:10px">
Can\'t create <b>'.$cacheGpxPath.'</b> folder. Please create it and make it writable!<br />
If not, cache will not created and your site could be slower!
</div>';
if ( ! @mkdir( $cacheGpxPath, 0755, true ) ) {
echo '<div class=" notice notice-error"><p>';
printf(
/* translators: Relative path of the GPX cache folder */
__( 'Can not create the cache folder %1s for the GPX files. Please create the folder and make it writable! If not, you will must update the files manually!', 'wp-gpx-maps' ),
'<span class="code"><strong>' . esc_html( $relativeGpxCachePath ) . '</strong></span>'
);
echo '</p></div>';
} }
} }
wpgpxmaps_ilc_admin_tabs( $tab );
if ( $tab == 'tracks' ) {
wpgpxmaps_ilc_admin_tabs($tab);
if ($tab == "tracks")
{
include 'wp-gpx-maps_admin_tracks.php'; include 'wp-gpx-maps_admin_tracks.php';
} } elseif ( $tab == 'settings' ) {
else if ($tab == "settings")
{
include 'wp-gpx-maps_admin_settings.php'; include 'wp-gpx-maps_admin_settings.php';
} elseif ( $tab == 'help' ) {
include 'wp-gpx-maps_help.php';
} }
else if ($tab == "help")
{
?>
<div style="padding:10px;">
<b>The fastest way to use this plugin:</b><br /> upload the file using the uploader in the first tab, than copy the shortcode from the list and paste it in the pages/posts.
<p>You can manually set the relative path to your gpx: <b>[sgpx gpx="<?php echo $relativeGpxPath; ?>&lt gpx file name &gt"]</b>.</p>
<p>You can also use gpx from other sites: <b>[sgpx gpx="http://www.someone.com/somewhere/somefile.gpx"]</b></p>
<hr />
<p>
<i>Full set of attributes:</i> <b>[sgpx gpx="<?php echo $relativeGpxPath; ?>&lt gpx file name &gt" </b>
&nbsp;&nbsp;&nbsp;<em>&gt&gt read below all the optional attributes &lt&lt</em>&nbsp;&nbsp;&nbsp;
<b>]</b>
<ul>
<li><b>gpx</b>: relative path to gpx
</li><li><b>width</b>: width in pixels
</li><li><b>mheight</b>: map height
</li><li><b>gheight</b>: graph height
</li><li><b>mtype</b>: map available types are: HYBRID, ROADMAP, SATELLITE, TERRAIN, OSM1 (Open Street Map), OSM2 (Open Cycle Map), OSM3 (Hike & Bike), OSM4 (Open Cycle Map - Transport), OSM5 (Open Cycle Map - Landscape), OSM6 (MapToolKit - Terrain)
</li><li><b>waypoints</b>: print the gpx waypoints inside the map (default is FALSE)
</li><li><b>donotreducegpx</b>: print all the point without reduce it (default is FALSE)
</li><li><b>pointsoffset</b>: skip points closer than XX meters(default is 10)
</li><li><b>uom</b>: distance/altitude possible unit of measure are: 0, 1, 2, 3, 4, 5 (0 = meters, 1 = feet/miles, 2 = meters/kilometers, 3 = meters/nautical miles, 4 = meters/miles, 5 = feet/nautical miles)
</li><li><b>mlinecolor</b>: map line color (default is #3366cc)
</li><li><b>glinecolor</b>: altitude line color (default is #3366cc)
</li><li><b>showspeed</b>: show speed inside the chart (default is FALSE)
</li><li><b>showhr</b>: show heart rate inside the chart (default is FALSE)
</li><li><b>showele</b>: show elevation data inside the chart (default is TRUE)
</li><li><b>showcad</b>: show cadence inside the chart (default is FALSE)
</li><li><b>showgrade</b>: show grade inside the chart (default is FALSE)
</li><li><b>glinecolorspeed</b>: speed line color (default is #ff0000)
</li><li><b>glinecolorhr</b>: heart rate line color (default is #ff77bd)
</li><li><b>glinecolorcad</b>: cadence line color (default is #beecff)
</li><li><b>glinecolorgrade</b>: grade line color (default is #beecff)
</li><li><b>uomspeed</b>: unit of measure for speed are: 0, 1, 2, 3, 4, 5 (0 = m/s, 1 = km/h, 2 = miles/h, 3 = min/km, 4 = min/miles, 5 = Nautical Miles/Hour (Knots), 6 = min/100 meters)
</li><li><b>chartFrom1</b>: minimun value for altitude chart
</li><li><b>chartTo1</b>: maxumin value for altitude chart
</li><li><b>chartFrom2</b>: minimun value for speed chart
</li><li><b>chartTo2</b>: maxumin value for speed chart
</li><li><b>startIcon</b>: Start track icon
</li><li><b>endIcon</b>: End track icon
</li><li><b>currentIcon</b>: Current position icon (when mouse hover)
</li><li><b>waypointicon</b>: waypoint custom icon
</li><li><b>nggalleries</b>: NextGen Gallery id or a list of Galleries id separated by a comma
</li><li><b>ngimages</b>: NextGen Image id or a list of Images id separated by a comma
</li><li><b>dtoffset</b>: the difference (in seconds) between your gpx tool date and your camera date
</li><li><b>zoomonscrollwheel</b>: zoom on map when mouse scroll wheel
</li><li><b>download</b>: Allow users to download your GPX file
</li><li><b>skipcache</b>: Do not use cache. If TRUE might be very slow (default is FALSE)
</li><li><b>summary</b>: Print summary details of your GPX (default is FALSE)
</li><li><b>summarytotlen</b>: Print Total distance in summary table (default is FALSE)
</li><li><b>summarymaxele</b>: Print Max Elevation in summary table (default is FALSE)
</li><li><b>summaryminele</b>: Print Min Elevation in summary table (default is FALSE)
</li><li><b>summaryeleup</b>: Print Total climbing in summary table (default is FALSE)
</li><li><b>summaryeledown</b>: Print Total descent in summary table (default is FALSE)
</li><li><b>summaryavgspeed</b>: Print Average Speed in summary table (default is FALSE)
</li><li><b>summaryavgcad</b>: Print Average Cadence in summary table (default is FALSE)
</li><li><b>summaryavghr</b>: Print Average Heart Rate in summary table (default is FALSE)
</li><li><b>summaryavgtemp</b>: Print Average Temperature in summary table (default is FALSE)
</li><li><b>summarytotaltime</b>: Print Total time in summary table (default is FALSE) </li>
</ul>
<p>
<a href="http://devfarm.it/forums/forum/wp-gpx-maps/">Bugs, problems, thanks and anything else here!</a>
</p>
</p>
</div>
<?php
}
} }
?> ?>

File diff suppressed because it is too large Load Diff

View File

@ -1,185 +1,214 @@
<?php <?php
if ( !(is_admin()) ) if ( ! ( is_admin() ) )
return; return;
$is_admin = current_user_can( 'manage_options' );
if ( $is_admin != 1 )
return;
$gpxRegEx = '/.gpx$/i';
if ( isset($_POST['clearcache']) ) $is_admin = current_user_can( 'publish_posts' );
{
if ( $is_admin != 1 )
if ( isset($_GET['_wpnonce']) return;
&&
wp_verify_nonce( $_GET['_wpnonce'], 'wpgpx_clearcache_nonce' . $entry ) $allow_users_upload = get_option( 'wpgpxmaps_allow_users_view' ) === "true";
)
{ $wpgpxmapsUrl = get_admin_url() . "admin.php?page=WP-GPX-Maps";
echo "Cache is now empty!";
wpgpxmaps_recursive_remove_directory($cacheGpxPath, true); $gpxRegEx = '/.gpx$/i';
}
if ( current_user_can( 'manage_options' ) ) {
$menu_root = 'options-general.php';
} elseif ( current_user_can( 'publish_posts' ) ) {
$menu_root = 'admin.php';
}
if ( isset( $_POST['clearcache'] ) ) {
if ( isset( $_GET['_wpnonce'] )
&&
wp_verify_nonce( $_GET['_wpnonce'], 'wpgpx_clearcache_nonce' . $entry )
) {
echo '<div class="notice notice-success"><p>';
_e( 'Cache is now empty!', 'wp-gpx-maps' );
echo '</p></div>';
wpgpxmaps_recursive_remove_directory( $cacheGpxPath, true );
} }
}
if ( is_writable( $realGpxPath ) ) {
if ( is_writable ( $realGpxPath ) ){
?> ?>
<div class="tablenav top"> <div class="tablenav top">
<form enctype="multipart/form-data" method="POST" style="float:left; margin:5px 20px 0 0" action="/wp-admin/options-general.php?page=WP-GPX-Maps"> <?php
Choose a file to upload: <input name="uploadedfile[]" type="file" onchange="submitgpx(this);" multiple /> echo '<form enctype="multipart/form-data" method="POST" style="float:left; margin:5px 20px 0 0" action="' . get_bloginfo( 'wpurl' ) . '/wp-admin/' . $menu_root . '?page=WP-GPX-Maps">';
<?php
if ( isset($_FILES['uploadedfile']) )
{
$total = count($_FILES['uploadedfile']['name']);
for($i=0; $i<$total; $i++) {
$uploadingFileName = basename( $_FILES['uploadedfile']['name'][$i]);
$target_path = $realGpxPath ."/". $uploadingFileName;
if (preg_match($gpxRegEx, $target_path))
{
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$i], $target_path)) {
echo "<br />File <b>". $uploadingFileName . "</b> has been uploaded";
} else{
echo "<br />There was an error uploading the file, please try again!";
}
}
else
{
echo "file not supported!";
}
}
}
?>
</form>
<form method="POST" style="float:left; margin:5px 20px 0 0" action="/wp-admin/options-general.php?page=WP-GPX-Maps&_wpnonce=<?php echo wp_create_nonce( 'wpgpx_clearcache_nonce' ) ?>" >
<input type="submit" name="clearcache" value="Clear Cache" />
</form>
</div>
<?php
}
else
{
?> ?>
<?php _e( 'Choose a file to upload:', 'wp-gpx-maps' ); ?> <input name="uploadedfile[]" type="file" onchange="submitgpx(this);" multiple />
<?php
if ( isset( $_FILES['uploadedfile'] ) ) {
$total = count( $_FILES['uploadedfile']['name'] );
for ( $i = 0; $i < $total; $i++ ) {
$uploadingFileName = basename( $_FILES['uploadedfile']['name'][$i] );
$target_path = $realGpxPath . "/" . $uploadingFileName;
if ( preg_match( $gpxRegEx, $target_path ) ) {
if ( move_uploaded_file( $_FILES['uploadedfile']['tmp_name'][$i], $target_path ) ) {
echo '<div class="notice notice-success"><p>';
printf(
/* translators: GPX file name */
__( 'The file %1s has been successfully uploaded.', 'wp-gpx-maps' ),
'<span class="code"><strong>' . esc_html( $uploadingFileName ) . '</strong></span>'
);
echo '</p></div>';
} else {
echo '<div class=" notice notice-error"><p>';
_e( 'There was an error uploading the file, please try again!', 'wp-gpx-maps' );
echo '</p></div>';
}
} else {
echo '<div class="notice notice-warning"><p>';
_e( 'The file type is not supported!', 'wp-gpx-maps' );
echo '</p></div>';
}
}
}
?>
</form>
<form method="POST" style="float:left; margin:5px 20px 0 0" action="<?php echo $wpgpxmapsUrl; ?>&_wpnonce=<?php echo wp_create_nonce( 'wpgpx_clearcache_nonce' ); ?>" >
<input type="submit" name="clearcache" value="<?php _e( 'Clear Cache', 'wp-gpx-maps' ); ?>" />
</form>
</div>
<?php
} else {
?>
<br /> <br />
<?php echo '<div class=" notice notice-error"><p>'; ?>
<p style='font-size:2em;'>
<?php
printf(
/* translators: Relative path of the GPX folder */
__( 'Your folder for GPX files %1s is not writable. Please change the folder permissions.', 'wp-gpx-maps' ),
'<span class="code">' . esc_html( $relativeGpxPath ) . '</span>'
);
?>
</p>
<?php echo '</p></div>'; ?>
<br /> <br />
<p style='font-size:2em;'>please make <b><?php echo $realGpxPath ?></b> folder writable. </p>
<br /> <?php
<br />
<?php
} }
$myGpxFileNames = array(); $myGpxFileNames = array();
if ( is_readable ( $realGpxPath ) && $handle = opendir($realGpxPath)) { if ( is_readable ( $realGpxPath ) && $handle = opendir( $realGpxPath ) ) {
while (false !== ($entry = readdir($handle))) { while ( false !== ( $entry = readdir( $handle ) ) ) {
if (preg_match($gpxRegEx, $entry )) if ( preg_match( $gpxRegEx, $entry ) ) {
{
if ( isset($_GET['_wpnonce']) if ( isset($_GET['_wpnonce'])
&& &&
wp_verify_nonce( $_GET['_wpnonce'], 'wpgpx_deletefile_nonce_' . $entry ) wp_verify_nonce( $_GET['_wpnonce'], 'wpgpx_deletefile_nonce_' . $entry )
) { ) {
if ( file_exists($realGpxPath ."/". $entry) ) if ( file_exists( $realGpxPath . "/" . $entry ) ) {
{ unlink( $realGpxPath . "/" . $entry );
unlink($realGpxPath ."/". $entry); echo '<div class="notice notice-success"><p>';
echo "<br/><b>$entry has been deleted.</b>"; printf(
} /* translators: GPX file name */
else { __( 'The file %1s has been successfully deleted.', 'wp-gpx-maps' ),
echo "<br/><b>Can't delete $entry.</b>"; '<span class="code"><strong>' . esc_html ( $entry ) . '</strong></span>'
);
} echo '</p></div>';
} } else {
else echo '<div class=" notice notice-error"><p>';
{ printf(
$myFile = $realGpxPath . "/" . $entry; /* translators: GPX file name */
$myGpxFileNames[] = array( __( 'The file %1s could not be deleted.', 'wp-gpx-maps' ),
'name' => $entry, '<span class="code"><strong>' . esc_html ( $entry ) . '</strong></span>'
'size' => filesize( $myFile ), );
'lastedit' => filemtime( $myFile ), echo '</p></div>';
'nonce' => wp_create_nonce( 'wpgpx_deletefile_nonce_' . $entry ),
);
} }
} else {
$myFile = $realGpxPath . "/" . $entry;
$myGpxFileNames[] = array(
'name' => $entry,
'size' => filesize( $myFile ),
'lastedit' => filemtime( $myFile ),
'nonce' => wp_create_nonce( 'wpgpx_deletefile_nonce_' . $entry ),
);
} }
} }
closedir($handle); }
} closedir( $handle );
}
if ( is_readable ( $realGpxPath ) && $handle = opendir($realGpxPath)) {
while (false !== ($entry = readdir($handle))) { if ( is_readable ( $realGpxPath ) && $handle = opendir( $realGpxPath ) ) {
if (preg_match($gpxRegEx,$entry )) while ( false !== ($entry = readdir( $handle ) ) ) {
{ if ( preg_match( $gpxRegEx, $entry ) ) {
$filenames[] = $realGpxPath . "/" . $entry; $filenames[] = $realGpxPath . "/" . $entry;
} }
} }
closedir($handle); closedir( $handle );
} }
$wpgpxmaps_gpxRelativePath = get_site_url(null, '/wp-content/uploads/gpx/');
?> ?>
<table id="table" class="wp-list-table widefat plugins"></table> <table id="table" class="wp-list-table widefat plugins"></table>
<script type="text/javascript"> <script type="text/javascript">
function submitgpx(el) function submitgpx(el)
{ {
var newEl = document.createElement('span'); var newEl = document.createElement('span');
newEl.innerHTML = 'Uploading file...'; newEl.innerHTML = '<?php _e( 'Uploading file...', 'wp-gpx-maps' ); ?>';
el.parentNode.insertBefore(newEl,el.nextSibling); el.parentNode.insertBefore(newEl,el.nextSibling);
el.parentNode.submit() el.parentNode.submit()
} }
jQuery('#table').bootstrapTable({ jQuery('#table').bootstrapTable({
columns: [{ columns: [{
field: 'name', field: 'name',
title: 'File', title: '<?php _e( 'File', 'wp-gpx-maps' ); ?>',
sortable: true, sortable: true,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return [ return [
'<b>' + row.name + '</b><br />', '<b>' + row.name + '</b><br />',
'<a class="delete_gpx_row" href="/wp-admin/options-general.php?page=WP-GPX-Maps&_wpnonce=' + row.nonce + '" >Delete</a>', '<a class="delete_gpx_row" href="<?php echo $wpgpxmapsUrl; ?>&_wpnonce=' + row.nonce + '" ><?php _e( 'Delete', 'wp-gpx-maps' ); ?></a>',
' | ', ' | ',
'<a href="<?php echo $wpgpxmaps_gpxRelativePath ?>' + row.name + '">Download</a>', '<a href="<?php echo $relativeGpxPath; ?>' + row.name + '"><?php _e( 'Download', 'wp-gpx-maps' ); ?></a>',
' | ', ' | ',
'Shortcode: [sgpx gpx="<?php echo $relativeGpxPath ?>' + row.name + '"]', '<a href="#" class="copy-shortcode" title="<?php _e( 'Copy shortcode', 'wp-gpx-maps' ); ?>"><?php _e( 'Shortcode:', 'wp-gpx-maps' ); ?></a> <span class="code"> [sgpx gpx="<?php echo $relativeGpxPath ?>' + row.name + '"]</span>',
].join('') ].join('')
} }
}, { }, {
field: 'lastedit', field: 'lastedit',
title: 'Last modified', title: '<?php _e( 'Last modified', 'wp-gpx-maps' ); ?>',
sortable: true, sortable: true,
formatter: function(value, row, index) { formatter: function(value, row, index) {
var d = new Date(value*1000); var d = new Date(value*1000);
return d.toLocaleDateString() + " " + d.toLocaleTimeString(); return d.toLocaleDateString() + " " + d.toLocaleTimeString();
} }
}, { }, {
field: 'size', field: 'size',
title: 'File size', title: '<?php _e( 'File size', 'wp-gpx-maps' ); ?>',
sortable: true, sortable: true,
formatter: function(value, row, index) { return humanFileSize(value); } formatter: function(value, row, index) { return humanFileSize(value); }
}], }],
sortName : 'lastedit', sortName : 'lastedit',
sortOrder : 'desc', sortOrder : 'desc',
data: <?php echo json_encode( $myGpxFileNames ) ?> data: <?php echo wp_json_encode( $myGpxFileNames ); ?>
}); });
jQuery('.delete_gpx_row').click(function(){ jQuery('.delete_gpx_row').click(function(){
return confirm("Are you sure you want to delete?"); return confirm("<?php _e( 'Are you sure you want to delete the file?', 'wp-gpx-maps' ); ?>");
}) })
function humanFileSize(bytes, si) { function humanFileSize(bytes, si) {
var thresh = si ? 1000 : 1024; var thresh = si ? 1000 : 1024;
if(Math.abs(bytes) < thresh) { if(Math.abs(bytes) < thresh) {
@ -196,6 +225,18 @@
return bytes.toFixed(1)+' '+units[u]; return bytes.toFixed(1)+' '+units[u];
} }
jQuery('.copy-shortcode').click(function(e){
var $temp = jQuery("<input>");
jQuery("body").append($temp);
var shortcode = jQuery(this).next().text().trim();
$temp.val(shortcode).select();
document.execCommand("copy");
$temp.remove();
e.preventDefault();
});
</script> </script>
@ -203,4 +244,4 @@
#table tr:hover { #table tr:hover {
background:#eeeeee; background:#eeeeee;
} }
</style> </style>

957
wp-gpx-maps_help.php Normal file
View File

@ -0,0 +1,957 @@
<div id="wpgpxmaps-tab-faq">
<div class="wpgpxmaps-container-tab-faq">
<div class="wpgpxmaps-tab-faq">
<h3 class="title"><?php _e( 'FAQ', 'wp-gpx-maps' ); ?></h3>
<p>
<strong><?php _e( 'How can I upload the GPX files?', 'wp-gpx-maps' ); ?></strong>
</p>
<p>
&nbsp; <?php _e( '1. Method: Upload the GPX file using the uploader in the tab "Tracks".', 'wp-gpx-maps' ); ?>
</p>
<p>
&nbsp;
<?php
_e( '2. Method: Upload the GPX file via FTP to your upload folder:', 'wp-gpx-maps' );
echo ' ';
?>
<code><strong> <?php echo $relativeGpxPath; ?> </strong></code>
</p>
<p>
<strong><?php _e( 'How can I use the GPX files?', 'wp-gpx-maps' ); ?></strong>
</p>
<p>
&nbsp; <?php _e( 'Go to the tab "Tracks" and copy the shortcode from the list and paste it in the page or post.', 'wp-gpx-maps' ); ?>
</p>
<p>
&nbsp;
<?php
_e( 'You can manually set the relative path to your GPX file. Please use this scheme:', 'wp-gpx-maps' );
echo ' ';
?>
<code><strong>[sgpx gpx="<?php echo $relativeGpxPath; ?>yourgpxfile.gpx"]</strong></code>
</p>
<p>
<strong><?php _e( 'Can I also integrate GPX files from other sites?', 'wp-gpx-maps' ); ?></strong>
</p>
<p>
&nbsp;
<?php
_e( 'Yes, it&#8217s possible. Please use this scheme:', 'wp-gpx-maps' );
echo ' ';
?>
<code><strong>[sgpx gpx="http://www.someone.com/somewhere/somefile.gpx"]</strong></code>
</p>
<p>
<strong><?php _e( 'Can I change the attributes for each GPX shortcode?', 'wp-gpx-maps' ); ?></strong>
</p>
<p>
&nbsp; <?php _e( 'Yes, it&#8217s possible. These changes ignore the default settings for each attribute.', 'wp-gpx-maps' ); ?>
</p>
<p>
&nbsp;
<?php
_e( 'The Full set of optional attributes can be found below. Please use this scheme:', 'wp-gpx-maps' );
echo ' ';
?>
<code><strong>[sgpx gpx="<?php echo $relativeGpxPath; ?>yourgpxfile.gpx &lt; <?php _e( 'read below all the optional attributes', 'wp-gpx-maps' ); ?> &gt;"]</strong></code>
</p>
</div>
<table class="widefat">
<thead>
<tr>
<th colspan="4">
<strong><?php _e( 'General', 'wp-gpx-maps' ); ?></strong>
</th>
</tr>
<tr>
<th scope="col">
<?php _e( 'Shortcode', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Description', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Possible values', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Current value', 'wp-gpx-maps' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>gpx</td>
<td>
<?php _e( 'relative path to the GPX file', 'wp-gpx-maps' ); ?>
</td>
<td>
<code><strong>gpx="/wp-upload dir/gpx/yourgpxfile.gpx"</strong></code>
</td>
<td>
<code><strong>gpx="<?php echo $relativeGpxPath; ?>yourgpxfile.gpx"</strong></code>
</td>
</tr>
<tr>
<td>width</td>
<td>
<?php _e( 'Map width', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php _e( 'Value in percent', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_width' ); ?>
</td>
</tr>
<tr>
<td>mheight</td>
<td>
<?php _e( 'Map height', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php _e( 'Value in pixels', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_height' ); ?>
</td>
</tr>
<tr>
<td>gheight</td>
<td>
<?php _e( 'Graph height', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php _e( 'Value in pixels', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_height' ); ?>
</td>
</tr>
<tr>
<td>download</td>
<td>
<?php _e( 'Allow users to download your GPX file', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_download' ); ?>
</td>
</tr>
<tr>
<td>skipcache</td>
<td>
<?php _e('Do not use cache. If TRUE might be very slow', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_skipcache' ); ?>
</td>
</tr>
</tbody>
</table>
<br />
<table class="widefat">
<thead>
<tr>
<th colspan="4">
<strong><?php _e( 'Map', 'wp-gpx-maps' ); ?></strong>
</th>
</tr>
<tr>
<th scope="col">
<?php _e( 'Shortcode', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Description', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Possible values', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Current value', 'wp-gpx-maps' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>mtype</td>
<td>
<?php _e( 'Map type', 'wp-gpx-maps' ); ?>
</td>
<td>
<strong>HYBRID, ROADMAP, SATELLITE, TERRAIN</strong>
<br />
<strong>OSM1</strong> = <?php _e( 'Open Street Map', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM2</strong> = <?php _e( 'Open Cycle Map', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM4</strong> = <?php _e( 'Open Cycle Map - Transport', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM5</strong> = <?php _e( 'Open Cycle Map - Landscape', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM6</strong> = <?php _e( 'MapToolKit - Terrain', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM7</strong> = <?php _e( 'Open Street Map - Humanitarian map style', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM9</strong> = <?php _e( 'Hike & Bike', 'wp-gpx-maps' ); ?>
<br />
<strong>OSM10</strong> = <?php _e( 'Open Sea Map', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_map_type' ); ?>
</td>
</tr>
<tr>
<td>mlinecolor</td>
<td>
<?php _e( 'Map line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#3366cc</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_map_line_color' ); ?>
</td>
</tr>
<tr>
<td>zoomonscrollwheel</td>
<td>
<?php _e( 'Zoom on map when mouse scroll wheel', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_zoomonscrollwheel' ); ?>
</td>
</tr>
<tr>
<td>waypoints</td>
<td>
<?php _e( 'Print the GPX waypoints inside the map', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_waypoint' ); ?>
</td>
</tr>
<tr>
<td>startIcon</td>
<td>
<?php _e( 'Start track icon', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_map_start_icon' ); ?>
</td>
</tr>
<tr>
<td>endIcon</td>
<td>
<?php _e( 'End track icon', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_map_end_icon' ); ?>
</td>
</tr>
<tr>
<td>currentIcon</td>
<td>
<?php _e( 'Current position icon (when mouse hover)', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_map_current_icon' ); ?>
</td>
</tr>
<tr>
<td>waypointicon</td>
<td>
<?php _e( 'Custom waypoint icon', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_map_waypoint_icon' ); ?>
</td>
</tr>
</tbody>
</table>
<br />
<table class="widefat">
<thead>
<tr>
<th colspan="4">
<strong><?php _e( 'Diagram', 'wp-gpx-maps' ); ?></strong>
</th>
</tr>
<tr>
<th scope="col">
<?php _e( 'Shortcode', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Description', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Possible values', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Current value', 'wp-gpx-maps' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>showele</td>
<td>
<?php _e( 'Show elevation data inside the chart', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>true</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_elevation' ); ?>
</td>
</tr>
<tr>
<td>glinecolor</td>
<td>
<?php _e( 'Altitude line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#3366cc</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_line_color' ); ?>
</td>
</tr>
<tr>
<td>uom</td>
<td>
<?php _e( 'Distance / Altitude unit of measure', 'wp-gpx-maps' ); ?>
</td>
<td>
<strong>0</strong> = <?php _e( 'meters / meters', 'wp-gpx-maps' ); ?>
<br />
<strong>1</strong> = <?php _e( 'feet / miles', 'wp-gpx-maps' ); ?>
<br />
<strong>2</strong> = <?php _e( 'meters / kilometers', 'wp-gpx-maps' ); ?>
<br />
<strong>3</strong> = <?php _e( 'meters / nautical miles', 'wp-gpx-maps' ); ?>
<br />
<strong>4</strong> = <?php _e( 'meters / miles', 'wp-gpx-maps' ); ?>
<br />
<strong>5</strong> = <?php _e( 'feet / nautical miles', 'wp-gpx-maps' ); ?>
<br />
</td>
<td>
<?php echo get_option( 'wpgpxmaps_unit_of_measure' ); ?>
</td>
</tr>
<tr>
<td>chartFrom1</td>
<td>
<?php _e( 'Minimum value for altitude chart', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_offset_from1' ); ?>
</td>
</tr>
<tr>
<td>chartTo1</td>
<td>
<?php _e( 'Maximum value for altitude chart', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_offset_to1' ); ?>
</td>
</tr>
<tr>
<td>showspeed</td>
<td>
<?php _e( 'Show speed inside the chart', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_speed' ); ?>
</td>
</tr>
<tr>
<td>glinecolorspeed</td>
<td>
<?php _e( 'Speed line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#ff0000</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_line_color_speed' ); ?>
</td>
</tr>
<tr>
<td>uomspeed</td>
<td>
<?php _e( 'Speed unit of measure', 'wp-gpx-maps' ); ?>
</td>
<td>
<strong>0</strong> = <?php _e( 'm/s', 'wp-gpx-maps' ); ?>
<br />
<strong>1</strong> = <?php _e( 'km/h', 'wp-gpx-maps' ); ?>
<br />
<strong>2</strong> = <?php _e( 'miles/h', 'wp-gpx-maps' ); ?>
<br />
<strong>3</strong> = <?php _e( 'min/km', 'wp-gpx-maps' ); ?>
<br />
<strong>4</strong> = <?php _e( 'min/miles', 'wp-gpx-maps' ); ?>
<br />
<strong>5</strong> = <?php _e( 'Knots (nautical miles / hour)', 'wp-gpx-maps' ); ?>
<br />
<strong>6</strong> = <?php _e( 'min/100 meters', 'wp-gpx-maps' ); ?>
<br />
</td>
<td>
<?php echo get_option( 'wpgpxmaps_unit_of_measure_speed' ); ?>
</td>
</tr>
<tr>
<td>chartFrom2</td>
<td>
<?php _e( 'Minimum value for speed chart', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_offset_from2' ); ?>
</td>
</tr>
<tr>
<td>chartTo2</td>
<td>
<?php _e( 'Maximum value for speed chart', 'wp-gpx-maps' ); ?>
</td>
<td></td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_offset_to2' ); ?>
</td>
</tr>
<tr>
<td>showhr</td>
<td>
<?php _e( 'Show heart rate inside the chart', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_hr' ); ?>
</td>
</tr>
<tr>
<td>glinecolorhr</td>
<td>
<?php _e( 'Heart rate line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#ff77bd</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_line_color_hr' ); ?>
</td>
</tr>
<td>showatemp</td>
<td>
<?php _e( 'Show temperature inside the chart', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_atemp' ); ?>
</td>
</tr>
<tr>
<td>glinecoloratemp</td>
<td>
<?php _e( 'Temperature line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#ff77bd</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_line_color_atemp' ); ?>
</td>
</tr>
<tr>
<td>showcad</td>
<td>
<?php _e( 'Show cadence inside the chart', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_cadence' ); ?>
</td>
</tr>
<tr>
<td>glinecolorcad</td>
<td>
<?php _e( 'Cadence line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#beecff</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_line_color_cad' ); ?>
</td>
</tr>
<tr>
<td>showgrade</td>
<td>
<?php _e( 'Show grade inside the chart', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_show_grade' ); ?>
</td>
</tr>
<tr>
<td>glinecolorgrade</td>
<td>
<?php _e( 'Grade line color', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>#beecff</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_graph_line_color_grade' ); ?>
</td>
</tr>
</tbody>
</table>
<br />
<table class="widefat">
<thead>
<tr>
<th colspan="3">
<strong><?php _e( 'Pictures', 'wp-gpx-maps' ); ?></strong>
</th>
</tr>
<tr>
<th scope="col">
<?php _e( 'Shortcode', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Description', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Possible values', 'wp-gpx-maps' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>nggalleries</td>
<td>
<?php _e( 'NextGen Gallery', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php _e( 'Gallery ID or a list of Galleries ID separated by a comma', 'wp-gpx-maps' ); ?>
</td>
</tr>
<tr>
<td>ngimages</td>
<td>
<?php _e( 'NextGen Image', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php _e( 'Image ID or a list of Images ID separated by a comma', 'wp-gpx-maps' ); ?>
</td>
</tr>
<tr>
<td>attachments</td>
<td>
<?php _e( 'Show all images that are attached to post', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
</tr>
<tr>
<td>dtoffset</td>
<td>
<?php _e( 'The difference between your GPX tool date and your camera date', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php _e( 'Value in seconds', 'wp-gpx-maps' ); ?>
</td>
</tr>
</tbody>
</table>
<br />
<table class="widefat">
<thead>
<tr>
<th colspan="4">
<strong><?php _e( 'Summary table', 'wp-gpx-maps' ); ?></strong>
</th>
</tr>
<tr>
<th scope="col">
<?php _e( 'Shortcode', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Description', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Possible values', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Current value', 'wp-gpx-maps' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>summary</td>
<td>
<?php _e( 'Print summary details of your GPX track', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary' ); ?>
</td>
</tr>
<tr>
<td>summarytotlen</td>
<td>
<?php _e( 'Print total distance in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_tot_len' ); ?>
</td>
</tr>
<tr>
<td>summarymaxele</td>
<td>
<?php _e( 'Print max. elevation in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_max_ele' ); ?>
</td>
</tr>
<tr>
<td>summaryminele</td>
<td>
<?php _e( 'Print min. elevation in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_min_ele' ); ?>
</td>
</tr>
<tr>
<td>summaryeleup</td>
<td>
<?php _e( 'Print total climbing in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_total_ele_up' ); ?>
</td>
</tr>
<tr>
<td>summaryeledown</td>
<td>
<?php _e( 'Print total descent in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_total_ele_down' ); ?>
</td>
</tr>
<tr>
<td>summaryavgspeed</td>
<td>
<?php _e( 'Print average speed in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_avg_speed' ); ?>
</td>
</tr>
<tr>
<td>summaryavgcad</td>
<td>
<?php _e( 'Print average cadence in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_avg_cad' ); ?>
</td>
</tr>
<tr>
<td>summaryavghr</td>
<td>
<?php _e( 'Print average heart rate in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_avg_hr' ); ?>
</td>
</tr>
<tr>
<td>summaryavgtemp</td>
<td>
<?php _e( 'Print average temperature in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_avg_temp' ); ?>
</td>
</tr>
<tr>
<td>summarytotaltime</td>
<td>
<?php _e( 'Print total time in summary table', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_summary_total_time' ); ?>
</td>
</tr>
</tbody>
</table>
<br />
<table class="widefat">
<thead>
<tr>
<th colspan="4">
<strong><?php _e( 'Advanced', 'wp-gpx-maps' ); ?></strong>
</th>
</tr>
<tr>
<th scope="col">
<?php _e( 'Shortcode', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Description', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Possible values', 'wp-gpx-maps' ); ?>
</th>
<th scope="col">
<?php _e( 'Current value', 'wp-gpx-maps' ); ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>pointsoffset</td>
<td>
<?php _e( 'Skip GPX points closer than XX meters', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>10</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_pointsoffset' ); ?>
</td>
</tr>
<tr>
<td>donotreducegpx</td>
<td>
<?php _e( 'Print all the GPX waypoints without reduce it', 'wp-gpx-maps' ); ?>
</td>
<td>
<?php
_e( 'Default is:', 'wp-gpx-maps' );
echo ' ';
?>
<strong>false</strong>
</td>
<td>
<?php echo get_option( 'wpgpxmaps_donotreducegpx' ); ?>
</td>
</tr>
</tbody>
</table>
</div>
<p>
<a href="http://devfarm.it/forums/forum/wp-gpx-maps/" target="_blank" rel="noopener noreferrer"><?php _e( 'Bugs, problems, thanks and anything else here!', 'wp-gpx-maps' ); ?></a>
</p>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -1,149 +1,128 @@
<?php <?php
function wpgpxmaps_isNGGalleryActive() { function wpgpxmaps_isNGGalleryActive() {
if (!function_exists('is_plugin_active')) {
require_once(wp_gpx_maps_sitePath() . '/wp-admin/includes/plugin.php'); if ( ! function_exists( 'is_plugin_active' ) ) {
} require_once( wp_gpx_maps_sitePath() . '/wp-admin/includes/plugin.php' );
return is_plugin_active("nextgen-gallery/nggallery.php"); }
} return is_plugin_active( 'nextgen-gallery/nggallery.php' );
}
function wpgpxmaps_isNGGalleryProActive() {
if (!function_exists('is_plugin_active')) { function wpgpxmaps_isNGGalleryProActive() {
require_once(wp_gpx_maps_sitePath() . '/wp-admin/includes/plugin.php');
} if ( ! function_exists( 'is_plugin_active' ) ) {
return is_plugin_active("nextgen-gallery-pro/nggallery-pro.php"); require_once( wp_gpx_maps_sitePath() . '/wp-admin/includes/plugin.php' );
} }
return is_plugin_active( 'nextgen-gallery-pro/nggallery-pro.php' );
}
function getNGGalleryImages($ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset, &$error)
{ function getNGGalleryImages( $ngGalleries, $ngImages, $dt, $lat, $lon, $dtoffset, &$error ) {
$result = array(); $result = array();
$galids = explode(',', $ngGalleries); $galids = explode( ',', $ngGalleries );
$imgids = explode(',', $ngImages); $imgids = explode( ',', $ngImages );
if (!wpgpxmaps_isNGGalleryActive()) if ( ! wpgpxmaps_isNGGalleryActive() )
return '';
try { return '';
try {
$pictures = array(); $pictures = array();
foreach ($galids as $g) { foreach ( $galids as $g ) {
$pictures = array_merge($pictures, nggdb::get_gallery($g)); $pictures = array_merge( $pictures, nggdb::get_gallery( $g ) );
} }
foreach ($imgids as $i) { foreach ( $imgids as $i ) {
array_push($pictures, nggdb::find_image($i)); array_push( $pictures, nggdb::find_image( $i ) );
} }
foreach ( $pictures as $p ) {
// print_r ($pictures); $item = array();
$item['data'] = $p->thumbHTML;
foreach ($pictures as $p) { if ( is_callable( 'exif_read_data' ) ) {
$exif = @exif_read_data( $p->imagePath );
$item = array(); if ( $exif !== false ) {
$item["data"] = $p->thumbHTML; $item['lon'] = getExifGps( $exif['GPSLongitude'], $exif['GPSLongitudeRef'] );
$item['lat'] = getExifGps( $exif['GPSLatitude'], $exif['GPSLatitudeRef'] );
if (is_callable('exif_read_data')) if ( ( $item['lat'] != 0 ) || ( $item['lon'] != 0 ) ) {
{ $result[] = $item;
$exif = @exif_read_data($p->imagePath); } elseif ( isset( $p->imagedate ) ) {
if ($exif !== false) $_dt = strtotime( $p->imagedate ) + $dtoffset;
{ $_item = findItemCoordinate( $_dt, $dt, $lat, $lon );
$item["lon"] = getExifGps($exif["GPSLongitude"], $exif['GPSLongitudeRef']); if ( $_item != null ) {
$item["lat"] = getExifGps($exif["GPSLatitude"], $exif['GPSLatitudeRef']); $item['lat'] = $_item['lat'];
if (($item["lat"] != 0) || ($item["lon"] != 0)) $item['lon'] = $_item['lon'];
{ $result[] = $item;
$result[] = $item; }
} }
else if (isset($p->imagedate)) }
{ } else {
$_dt = strtotime($p->imagedate) + $dtoffset; $error .= "Sorry, <a href='https://php.net/manual/en/function.exif-read-data.php' target='_blank' rel='noopener noreferrer'>exif_read_data</a> function not found! check your hosting..<br />";
$_item = findItemCoordinate($_dt, $dt, $lat, $lon); }
if ($_item != null) }
{ /* START FIX NEXT GEN GALLERY 2.x */
$item["lat"] = $_item["lat"]; if ( class_exists( 'C_Component_Registry' ) ) {
$item["lon"] = $_item["lon"]; $renderer = C_Component_Registry::get_instance()->get_utility( 'I_Displayed_Gallery_Renderer' );
$result[] = $item; $params['gallery_ids'] = $ngGalleries;
} $params['image_ids'] = $ngImages;
} $params['display_type'] = NEXTGEN_GALLERY_BASIC_THUMBNAILS;
} $params['images_per_page'] = 999;
} /* Salso add js references to get the gallery working */
else $dummy = $renderer->display_images( $params, $inner_content );
{
$error .= "Sorry, <a href='http://php.net/manual/en/function.exif-read-data.php' target='_blank' >exif_read_data</a> function not found! check your hosting..<br />"; /* START FIX NEXT GEN GALLERY PRO */
}
} if ( preg_match( "/data-nplmodal-gallery-id=[\"'](.*?)[\"']/", $dummy, $m ) ) {
$galid = $m[1];
if ( $galid ) {
/* START FIX NEXT GEN GALLERY 2.x */ for( $i = 0; $i < count( $result ); ++$i ) {
$result[$i]['data'] = str_replace( '%PRO_LIGHTBOX_GALLERY_ID%', $galid, $result[$i]['data'] );
if ( class_exists("C_Component_Registry") ) }
{ }
}
$renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer'); /* END FIX NEXT GEN GALLERY PRO */
$params['gallery_ids'] = $ngGalleries; }
$params['image_ids'] = $ngImages; /* END FIX NEXT GEN GALLERY 2.x */
$params['display_type'] = NEXTGEN_GALLERY_BASIC_THUMBNAILS;
$params['images_per_page'] = 999; } catch ( Exception $e ) {
// also add js references to get the gallery working $error .= 'Error When Retrieving NextGen Gallery galleries/images: $e <br />';
$dummy = $renderer->display_images($params, $inner_content); }
return $result;
/* START FIX NEXT GEN GALLERY PRO */ }
if (preg_match("/data-nplmodal-gallery-id=[\"'](.*?)[\"']/", $dummy, $m)) function findItemCoordinate( $imgdt, $dt, $lat, $lon ) {
{
$galid = $m[1]; foreach ( array_keys( $dt ) as $i ) {
if ($galid) if ( $i!=0 && $imgdt >= $dt[$i-1] && $imgdt <= $dt[$i] ) {
{ if ( $lat[$i] != 0 && $lon[$i] != 0 )
for($i = 0; $i < count($result); ++$i) return array( 'lat' => $lat[$i], 'lon' => $lon[$i] );
{ }
$result[$i]["data"] = str_replace("%PRO_LIGHTBOX_GALLERY_ID%", $galid, $result[$i]["data"]); }
} return null;
} }
}
/* END FIX NEXT GEN GALLERY PRO */ function getExifGps( $exifCoord, $hemi ) {
}
$degrees = count( $exifCoord ) > 0 ? gps2Num( $exifCoord[0] ) : 0;
/* END FIX NEXT GEN GALLERY 2.x */ $minutes = count( $exifCoord ) > 1 ? gps2Num( $exifCoord[1] ) : 0;
$seconds = count( $exifCoord ) > 2 ? gps2Num( $exifCoord[2] ) : 0;
} catch (Exception $e) { $flip = ( $hemi == 'W' or $hemi == 'S' ) ? -1 : 1;
$error .= 'Error When Retrieving NextGen Gallery galleries/images: $e <br />';
} return $flip * ( $degrees + $minutes / 60 + $seconds / 3600);
}
return $result;
} function gps2Num( $coordPart ) {
function findItemCoordinate($imgdt, $dt, $lat, $lon) $parts = explode( '/', $coordPart );
{
foreach(array_keys($dt) as $i) if ( count( $parts ) <= 0 )
{ return 0;
if ($i!=0 && $imgdt >= $dt[$i-1] && $imgdt <= $dt[$i])
{ if ( count( $parts ) == 1 )
if ($lat[$i] != 0 && $lon[$i] != 0) return $parts[0];
return array( "lat" => $lat[$i], "lon" => $lon[$i] );
} $lat = floatval( $parts[0] );
} $lon = floatval( $parts[1] );
return null;
} if ($lon == 0 )
return $lat;
function getExifGps($exifCoord, $hemi) return $lat / $lon;
{ }
$degrees = count($exifCoord) > 0 ? gps2Num($exifCoord[0]) : 0; ?>
$minutes = count($exifCoord) > 1 ? gps2Num($exifCoord[1]) : 0;
$seconds = count($exifCoord) > 2 ? gps2Num($exifCoord[2]) : 0;
$flip = ($hemi == 'W' or $hemi == 'S') ? -1 : 1;
return $flip * ($degrees + $minutes / 60 + $seconds / 3600);
}
function gps2Num($coordPart)
{
$parts = explode('/', $coordPart);
if (count($parts) <= 0)
return 0;
if (count($parts) == 1)
return $parts[0];
$lat = floatval($parts[0]);
$lon = floatval($parts[1]);
if ($lon == 0)
return $lat;
return $lat / $lon;
}
?>