Comments (5)
You can use the Polyline Encoder library to decode the Polyline field. It returns the coordinates of each points.
Edit: fixed link
from stravaphp.
Hi @qligier, the URL in your post doesn't go anywhere. I think you mean Polyline Encoder, which I have used and is excellent.
Btw, PHP-Geometry contains a nice implementation of the Ramer–Douglas–Peucker algorithm. This gives you a similar looking line from fewer points.
Instead of decoding the polyline into lat-lngs at the server side, you could do this in the browser if you use Leaflet maps through the Leaflet.encoded plugin. Other maps have similar functionality too :)
from stravaphp.
@richtt a couple of issues I have bumped into with encoded polylines:
- If you pass the encoded polyline as part of browser URL, remember that you should limit the overall URL length to 2,000 characters - this can be an issue for encoded polylines that represent thousands of lat-lngs.
- Escaping of special characters in encoded polylines. I've seen at least backslashes and have used PHP's addslashes and stripslashes to remedy things, particularly if you're storing/retrieving from a database.
from stravaphp.
Yes, sorry for the link. I only knew the older google-map-polyline-encoding-tool and I've changed it just before sending the message.
The Leaflet.encoded plugin seems a very good alternative.
from stravaphp.
Stale issue message
from stravaphp.
Related Issues (20)
- Refresh Tokens Update HOT 2
- Integration with Laravel project
- Handling Strava's conversion to oauth2 HOT 11
- Is this repo still maintained? HOT 6
- getAthleteActivities is buggy when using parameters
- getResponse doesn't throw, it already catches HOT 3
- PHPUnit tests fail when running locally HOT 2
- Laravel 8 incompatibility HOT 6
- Can you do a point release? HOT 5
- Where is autoload.php HOT 2
- Upload gpx file failed HOT 1
- Wrong scopes in README.md code examples HOT 1
- Library Compatibility HOT 11
- GitHub Link Broken HOT 3
- Scrutinizer HOT 3
- Setup Packagist for automatic updates HOT 9
- Webhook Subscriptions HOT 2
- Fix tests after type hints HOT 1
- getSegmentLeaderboard not working HOT 5
- Having trouble getting OAuth2 to work and missing refresh token HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stravaphp.