Reputation: 18521
I´m building a PHP system where the user will type some GPS coordinates into a table and then the web system will pinpoint that position using google maps. In future we will develop an app for that, but for now the user has to type on the web page his coordinates.
My problem is regarding converting the cellular GPS coordinates to google maps format. We are using the cellular coordinates as decimal degrees DD.DDDD
and the cellular show these values ie:
20.23223oS, 46.2737oO
But google maps accepts real numbers, as:
center: new google.maps.LatLng(20.23223, 46.2737)
With this code it does not show the location I can see on my cellular.
How can I convert the above coordinates to google maps ? Can someone has a PHP code for example ?
Thanks for helping.
Upvotes: 1
Views: 1094
Reputation: 133400
Ith the location is in Brazil youn simply should remove the last two char for lat (oS) S= South and for lng (oO) O = West and change the sign (both are negative)
Make sure your conversion obtain an negative latitude, longitute (West) in some case if you don't speficy correctly google maps could convert automatically postive value
Upvotes: 1