marchdev-tk / google_polyline_algorithm Goto Github PK
View Code? Open in Web Editor NEWDart implementation of Googles Polyline Encoding lossy compression Algorithm.
License: BSD 3-Clause "New" or "Revised" License
Dart implementation of Googles Polyline Encoding lossy compression Algorithm.
License: BSD 3-Clause "New" or "Revised" License
In the decodePolyline method the ~ operator is used. I don't believe that this operator works as expected on Chrome. If you run the example in the library the negative longitudes are incorrect as a result. Things are fine on Android.
Windows 10/64 bit
A possible fix/workaround:
final coordinateChange =
//(result & 1) != 0 ? ~(result >> 1) : (result >> 1);
(result & 1) != 0 ? (~BigInt.from(value)).toInt() : value;
How do I convert the return from decodePolyline to List?
print(result.length);
List resultado = decodePolyline(road.polylineEncoded.toString());
print(resultado);
print(resultado.length);
full code https://github.com/AlysonTrizotto/LocalizaCliente/blob/main/lib/componentes/rota.dart
Hello,
Is there anything we can do for this annoying problem when the encoder encodes string with backslashes etc and then dart can't read it correctly and I am still getting Invalid value: Not in inclusive range when decoding it
Error:type 'List<List>' is not a subtype of type 'List<List>' in type cast
When I'm trying to pass a list of coordinates to encode getting the above issue.
Example:List of coordinates
[[26.7784002, 75.8425027], [26.7786778, 75.8425991], [26.7787995, 75.8428689], [26.7787386, 75.8431947], [26.7786963, 75.8435242], [26.7788872, 75.8437456], [26.7790054, 75.843449], [26.77906, 75.8431203], [26.7791082, 75.8428205], [26.7791817, 75.8425138], [26.7790115, 75.8422522], [26.7790001, 75.8419491], [26.7792244, 75.8417791], [26.7794847, 75.8418831], [26.7794877, 75.8421887], [26.7792773, 75.8424163], [26.7790088, 75.8422836], [26.7787782, 75.8421037], [26.7784653, 75.8420592], [26.7781823, 75.8420604], [26.7781429, 75.8423668]]
Some code of snapshot below
List temp=[];
for (int j = 0; j < getRoutesData!.data![i].routeCoordinates!.length; j++)
{
temp.add([getRoutesData!.data![i].routeCoordinates![j].lat,
getRoutesData!.data![i].routeCoordinates![j].lng].toString());
}
getRoutesData!.data![i].dataList.add(temp);
getRoutesData!.data![i].dataString=getRoutesData!.data![i].dataList.join(','+' ');
getRoutesData!.data![i].encodedString=encodePolyline(getRoutesData!.data![i].dataList as List<List>);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.