Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoGoCarto
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pixel Humain
GoGoCarto
Commits
1cf02555
Unverified
Commit
1cf02555
authored
5 years ago
by
Sebastian Castro
Browse files
Options
Downloads
Patches
Plain Diff
Fixs coordinates outside of -180/180
parent
e3b6a711
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Biopen/GeoDirectoryBundle/Document/Coordinates.php
+6
-6
6 additions, 6 deletions
src/Biopen/GeoDirectoryBundle/Document/Coordinates.php
with
6 additions
and
6 deletions
src/Biopen/GeoDirectoryBundle/Document/Coordinates.php
+
6
−
6
View file @
1cf02555
...
...
@@ -9,14 +9,14 @@ use JMS\Serializer\Annotation\Expose;
class
Coordinates
{
/**
*
*
* @Expose
* @MongoDB\Field(type="float")
*/
public
$latitude
=
0
;
/**
*
*
* @Expose
* @MongoDB\Field(type="float")
*/
...
...
@@ -24,9 +24,9 @@ class Coordinates
public
function
__construct
(
$lat
=
null
,
$lng
=
null
)
{
$this
->
setLatitude
(
$lat
);
$this
->
setLatitude
(
$lat
);
$this
->
setLongitude
(
$lng
);
}
}
/**
* Set latitude
...
...
@@ -36,7 +36,7 @@ class Coordinates
*/
public
function
setLatitude
(
$latitude
)
{
$this
->
latitude
=
number_format
(
$latitude
,
5
);
$this
->
latitude
=
number_format
(
$latitude
%
180
,
5
);
return
$this
;
}
...
...
@@ -58,7 +58,7 @@ class Coordinates
*/
public
function
setLongitude
(
$longitude
)
{
$this
->
longitude
=
number_format
(
$longitude
,
5
);
$this
->
longitude
=
number_format
(
$longitude
%
180
,
5
);
return
$this
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment