Baidu map auto zoom - baidu

I'm creating an interactive map using baidu. Anyone knows how to use bound in Baidu / auto zoom? Is there any auto zoom function in Baidu map?
I can't find anything on their documentation. Maybe there is but it's in Chinese, I can't read Chinese :(
Baidu documentation: http://developer.baidu.com/map/index.php?title=jspopular
Also found this but i cant find any instruction on how to use it.
http://developer.baidu.com/map/reference/index.php?title=Class:%E5%9F%BA%E7%A1%80%E7%B1%BB/Bounds
THanks in advance!

Found the solution! Store marker points to an array and use getViewport() method to get the computed center and zoom. Hope this find helpful to anyone.
map_center = map.getViewport( array_of_marker_points);
map.centerAndZoom( map_center.center.lng , map_center.center.lat , map_zoom);

Related

Loading ESRI raster in Mapbox GL JS

Is it possible to load ESRI raster tiles from a tiles.arcgis.com service? In this mapbox demo, the line that specifies the basemap tiling service (from Stamen, in this case) is this:
'tiles': [
'https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg'
],
When I edit the fiddle example, however, and try to substitute a tileset I'm interested in using, it doesn't seem to work:
'tiles': [
'https://tiles.arcgis.com/tiles/QcN4ko50whTktDF1/arcgis/rest/services/Ortho_Midland2020_0520and0521/MapServer/tile/{z}/{x}/{y}.jpg'
],
I was able to get direct access to some of the individual tiles, like this, but can't seem to get the URL string right. Here is a page with metadata, as well as the start and end tiles for each zoom level.
Can someone please point out where I'm going wrong with that URL string? I've also changed the initial zoom and x/y to be relevant to the dataset:
center: [-84.39479, 43.820487],
zoom: 11
Here is a fiddle that I've been trying out various URLs in. I would super appreciate pointers about how to format the ESRI tileset URL for use in mapbox gl js. Thanks in advance!
Two issues:
First, the URLs should not have .jpg on the end.
Second, ArcGIS online URLs are z/y/x, not z/x/y
So the correct URL is:
https://tiles.arcgis.com/tiles/QcN4ko50whTktDF1/arcgis/rest/services/Ortho_Midland2020_0520and0521/MapServer/tile/{z}/{y}/{x}
Updated JS Fiddle: https://jsfiddle.net/stevage/z9nao1cv/4/

Is there an equivalent to visibleMapRect of IOS in QT/QML?

In IOS, visibleMapRect returns the area currently displayed by the map view.
With Qt/QML, we are able to get individual coordinates from points on the screen like :
PointNW = map.toCoordinate(Qt.point(0,0))
Is there a method to directly get back the geoRectangle currently displayed in Qt/QML ?
Thanks for help
Ok, I find it ! The answer is : visibleRegion
Doc here : http://doc.qt.io/qt-5/qml-qtlocation-map.html#visibleRegion-prop
How to use it in C++ here : QML Map visible region

javascript google map v3 and data property missing

Trying to load a geojson result into my google map. According to the documentation ("Every Map has a Data object by default, so most of the time there is no need to construct one.") I can just do map.data.loadGeoJson. The problem is that there is no data property on map. So I tried to just create on by doing google.maps.Data(). Again Data is not a recognized type. This comes from documentation of version 3.16. Can anybody tell me what I am doing wrong? this is the url I use to reference map:
https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=false&language=en&v=3.16
It's a property of the google.maps.Map-instance:
var someMapInstance=new google.maps.Map(/*arguments*/);
//someMapInstance.data will be what you are looking for
console.log(someMapInstance.data);
Now it is showing up. I had recently changed my link from version 3.14 to 3.16 so maybe it just got stuck in cache though not sure how since the url was different but either way it is working now.

UIImageOrientation/UIImagePickerController

I am using the Camera to take pictures in an IOS app.
It works, the only issue I have is when I try to figure out how the user was holding the device when taking the picture.
It would be much better if I could display the images in a proper way, not upside down or rotated 90 degrees.
Looking for a solution leads me to the fact that I should use the imageOrientation of UIImage but in reality:
theImage.imageOrientation is always equal to UIImageOrientationUp
What am I missing?
I did various research and experiment but nothing changes.
I am not showing any more code at this point, for the simple reason, I do not know which part to show to help find the problem.
Since I was able to find a solution on my own. I put it here, in case it may be useful to someone else.
Looking at the value of the "imageOrientation" field on the saved image (like I was doing), indeed for some reason always shows up as UIImageOrientationUp.
On the other hand looking at it inside the imagePickerController:didFinishPickingMediaWithInfo: is much more meaningful.
After some more research and trials, I ended up with a method looking like that:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
……
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
……
if ((image.imageOrientation==UIImageOrientationLeft)||
(image.imageOrientation==UIImageOrientationRight)||
(image.imageOrientation==UIImageOrientationDown)) {
UIGraphicsBeginImageContext(image.size);
[image drawAtPoint:CGPointMake(0.0, 0.0)];
image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
NSData *mediaData = UIImagePNGRepresentation(image);
……
}
And then my picture shows properly oriented, when I want to use it later in my app.

how to get address by passing latlong using google map in flex

when a marker is drag on google map we can get the latlong right.But i wanna get the location
name whenever i drag the marker,so how can i get it can anyone help me?
regards
vinit
You should use reverse geocoding for that :) I haven't done it in flash, only asp.net, but I found an example that implements this:
http://groups.google.com/group/google-maps-api-for-flash/browse_thread/thread/b6c5d13f06e6879b

Resources