Comments (4)
If we stick to using GeoJSON, won't we always have this problem? The 2 points mentioned in #20 (comment) can be ignored if we just drop the GeoJSON requirement.
I think users would have a nicer time if they use types rather than need to create untyped JSONs. Why don't we use types provided by library?
from mapbox-maps-flutter.
MapboxView
& MapboxController
would be more idiomatic
from mapbox-maps-flutter.
Hi @ben-xD,
you actually don't have to use turf here. The underlying data standard is GeoJSON. GeoJSON is itself based on JSON to represent geo data.
And if you want GeoJSON in a serialized Dart-representation, it consists of Maps, Lists, and numbers.
So the GeoJSON that you want to inject into the CameraOptions.center
attribute can look like this (without turf library):
CameraOptions(
center: {
"type": "Point",
"coordinates": [-80.1263, 25.7845]
}
// ...
),
// ...
Or isolated:
{
"type": "Point",
"coordinates": [-80.1263, 25.7845]
}
What turf simply provides, is an optional to use class-object representation of GeoJSON. Check it out in the README of the turf library https://github.com/dartclub/turf_dart.
The output of the Point.toJson
method is the same Dart Map/List/number representation as shown in my example.
The benefits of using turf with Mapbox can be static analysis and runtime checks, to make sure if the GeoJSON data structures are valid.
from mapbox-maps-flutter.
LatLng center;
A new data type LatLng
could add a lot of confusion, because:
- It does not really correspond to the
Point
orPosition
/coordinate data type from the GeoJSON RFC standard, that Mapbox is using for the representation of the geo data. - The actual order of the
Position
's/coordinate's dimensions are: [LONGITUDE, LATITUDE, ALTITUDE (optional)] See here RFC. So to stay compliant with the GeoJSON standard regarding the order of the dimensions is important.
Though I totally see, that it would make sense to have more type information than just Map<String?, Object?>
("a Map with some String? keys and some Object? values")...
from mapbox-maps-flutter.
Related Issues (20)
- [Android] Crash split_config.arm64_v8a.apk!libmapbox-maps.so HOT 1
- Location puck is drawn below LineLayer HOT 8
- Vector Layer Issue HOT 4
- Tap/Scroll Listeners no longer recognized HOT 1
- Method getLayer("puck") throws "Layer puck is not in style" HOT 1
- Mapbox Pop Up HOT 2
- Point Annotation image update not working on ios HOT 8
- iOS Crash After Migration from mapbox_gl to mapbox_maps_flutter HOT 1
- flat point annotation image HOT 1
- Can not add image to the Snaphotter
- Is there a way to move location puck to other lat/lng
- Line stays the same width independent of zoom level HOT 1
- Tap on Marker on Layer?
- Namespace issue HOT 1
- Branch protection on main not adhering to best practices
- Circle radius does not remain same while zoom in or out HOT 2
- PointAnnotation image does not update HOT 1
- Conflict issue.
- addSource / updateGeoJSON slow performance on Android
- [BUG] MissingPluginException ... platform#releaseMethodChannels
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 mapbox-maps-flutter.