Comments (3)
@arslankaleem7229 You can use MapboxMap.coordinateForPixel()
to get the coordinates of a location in the center of the map.
from mapbox-maps-flutter.
Thanks @evil159 . Its working fine. But there as issue with this I am using screen center using MediaQuery for giving x and y but the coordinates I am getting in return are not accurate
double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height;
double middleX = screenWidth / 2;
double middleY = screenHeight / 2;
mapboxMap.coordinateForPixel(mapbox.ScreenCoordinate(
x: middleX.roundToDouble(),
y: middleY.roundToDouble())
).then((value) async {
print(value)
});
from mapbox-maps-flutter.
@arslankaleem7229
void _onCameraChanged() async { final center = await _controller!.getCameraState(); final centerLatLng = LatLng( (center.center['coordinates'] as List)[1], (center.center['coordinates'] as List)[0], ); }
from mapbox-maps-flutter.
Related Issues (20)
- 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
- Adding a symbol layer does not work
- [ iOS ] How to remove or hide the lat-lon-zoom-bearing info window ? HOT 3
- I'm trying to add an image (Uint8List) to the maps style, but i get a error: Throwable, java.lang.Throwable: mismatched image size, Cause: null, Stacktrace: java.lang.Throwable: mismatched image size HOT 7
- 🐛 Android is exploding - GL error 0x501 - Flutter 3.22.0 HOT 1
- How to change styleUri HOT 1
- Animate marker position
- setBounds works only one time
- I want to use addLayer, but i get a error: PlatformException(java.lang.Throwable: value must be a number, Throwable, Cause: null, Stacktrace: java.lang.Throwable: value must be a number
- In Android When I close the page that contains the map, system says I'm still accessing location information
- Adding GeoJSON Layer in onMapCreated is unreliable HOT 1
- raster-color is int?
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.