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

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

Related

Baidu map auto zoom

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);

JMapViewer adding tiles of a region on Panel

Hi there i'm using JMapViewer to show maps in my swing app and I've successfully created a panel with map tiles on it but these map tiles are of a particular area used in demo source of Map Viewer, i'm confused about how can i show the tiles of some particular area i want. Just like Google maps i want to show some location of my country (Pakistan) in the maps and i don't know how can i do it.
Secondly, Please explain what are Layer's and Layer Group in JMapViewer? Just an idea.
Edit: how can i download tiles of Islamabad region and then add them to maps.
What i've learnt from demo is this:
private void loadMapTiles(){
map().setTileSource(new OsmTileSource.Mapnik());
map().setTileLoader(new OsmTileLoader(map()));
}
But this shows some specific area they have set to.
I've downloaded JTileDownloader but i'm confused about the url thing because i don't now where to get the url of some specific area.
Given a JMapViewer named map, something like this should display Islamabad:
Coordinate c = new Coordinate(33.7167, 73.0667);
map.setDisplayPosition(c, 10);
org.openstreetmap.gui.jmapviewer.Demo, included in the distribution, is a complete example that illustrates how to use Layer. Click the Tree Layers Visible checkbox to see the effect.
Addendum: Here's the result using MapQuest-OSM at 11x zoom; Mapnik seems to work, too. If no TileSource includes the tiles you want, you may need one of the approaches mentioned here.

Double clicking a google earth treeview node does not 'flyto' the placemark

I am using the plugin in a desktop application (Visual Studio C#). I am creating a placemark using the following code:
// Create a new coordinate object based on the lat/lon of the device
// TODO :: add lat/lon once data is available
FC.GEPluginCtrls.Geo.Coordinate Coord =
new FC.GEPluginCtrls.Geo.Coordinate(0, 0, 0, AltitudeMode.RelativeToGround);
// Create a placemark and put it in the tree.
kmlTreeView.ParseKmlObject(KmlHelpers.CreatePlacemark(
ge,
Coord,
((Device)DeviceList[i]).sSerialNum, // ID
((Device)DeviceList[i]).sNickname, // Name - shown in tree
((Device)DeviceList[i]).sName)); // Description - shown in bubble
In the TreeView the new nodes show up and when I double-click on them the bubble pops up with information in it but the view does not change. I attempted to verify the property "public bool FlyToOnDoubleClickNode" as shown in the documentation but that property apparently does not exist in the version I am using (1.010).
When I was loading a KML file the double click worked as expected but ever since I've been manually adding the placemarks it does not work.
Any thoughts?
Thanks!
Have you tried manually assigning a <LookAt> or <Camera> ?
That should work
Edit: Well the FlyToOnDoubleClickNode is turned on by default, so your problems lie elsewhere
I do not know why you are having troubles with setting multiple LookAts. Have you tried assigning 'ids' to your LookAt ? Depending on what you are actually doing, that might help.
Otherwise, have you seen setFlyToView()
I am not sure that will help you though, since it relates to KMLs loaded via NetworkLinks
Thats about me for ideas - good luck!
It appears that the coordinates 0,0 are somehow significant. If the coordinates are changed to something else the "FlyTo" works (0.1 and 0.1 work).

IvoryGoogleMap - can't display infoWindow

i'm trying to use IvoryGoogleMap to display a simple map with markers and infoWindows using this code:
$marker ->setPosition($place->getLat(), $place->getLng());
$infoWindow ->setContent('<p>Default content</p>');
$marker ->setInfoWindow($infoWindow);
$map ->addMarker($marker);
and all i'm getting is a map with marker(s) but when i click on one of them, nothing happens. Have you any idea what am i doing wrong ?
Ok, problem solved. Here is the solution from bundle's author egeloen (on github):
======================================================================
This functionality doesn't exist natively. If you want to open an info window with a click event on a marker, you need to use the ivory_google_map.event service. This service allow you to generate all events you want.
In your case, the event is :
$clickEvent = $this->get('ivory_google_map.event');
$clickEvent->setInstance($marker->getJavascriptVariable());
$clickEvent->setEventName('click');
$clickEvent->setHandle(sprintf('function(){%s.open(%s, %s);}',
$infoWindow->getJavascriptVariable(),
$map->getJavascriptVariable(),
$marker->getJavascriptVariable()
);
$map->getEventManager()->addEvent($clickEvent);

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