Skip to content

Commit

Permalink
allow negative numbers for lat/lon/alt, close #14
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins committed Jan 22, 2018
1 parent b88997a commit 1d8f42a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin.info.txt
@@ -1,7 +1,7 @@
base geotag
author Mark C. Prins
email mprins@users.sf.net
date 2016-09-02
date 2018-01-22
name geotag plugin
desc Allow a user to annotate pages with a geotag
url http://www.dokuwiki.org/plugin:geotag
10 changes: 5 additions & 5 deletions syntax/geotag.php
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (c) 2011-2016 Mark C. Prins <mprins@users.sf.net>
* Copyright (c) 2011-2018 Mark C. Prins <mprins@users.sf.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -71,9 +71,9 @@ public function connectTo($mode) {
public function handle($match, $state, $pos, Doku_Handler $handler) {
$tags = trim(substr($match, 9, - 2));
// parse geotag content
preg_match("(lat[:|=]\d*\.\d*)", $tags, $lat);
preg_match("(lon[:|=]\d*\.\d*)", $tags, $lon);
preg_match("(alt[:|=]\d*\.?\d*)", $tags, $alt);
preg_match("(lat[:|=]-?\d*\.\d*)", $tags, $lat);
preg_match("(lon[:|=]-?\d*\.\d*)", $tags, $lon);
preg_match("(alt[:|=]-?\d*\.?\d*)", $tags, $alt);
preg_match("/(region[:|=][\p{L}\s\w'-]*)/u", $tags, $region);
preg_match("/(placename[:|=][\p{L}\s\w'-]*)/u", $tags, $placename);
preg_match("/(country[:|=][\p{L}\s\w'-]*)/u", $tags, $country);
Expand Down Expand Up @@ -195,7 +195,7 @@ public function render($mode, Doku_Renderer $renderer, $data) {
* @param float $lon
*/
private function _geohash($lat, $lon) {
if (!$geophp = &plugin_load('helper', 'geophp')) {
if (!$geophp = plugin_load('helper', 'geophp')) {
dbglog($geophp, 'syntax_plugin_geotag_geotag::_geohash: geophp plugin is not available.');
return "";
}
Expand Down

0 comments on commit 1d8f42a

Please sign in to comment.