Determine the map's load status in QML - qt

I have a QT project including a QML map which loads a plugin such as Google-map. I want to know is there a way to check QML Map rendering/loading status without a third party library?
Component.onCompleted gets triggered only for the first time the Map element is loaded. On subsequent operations with the map, like dragging, the map loads in tiles but I can't find any way to know when the map is completely drawn.
I know that using Esri.ArcGISRuntime in my project as a third party library leads to arise the event onLoadStatusChanged including load status, like Enums.LoadStatusFailedToLoad, Enums.LoadStatusLoaded, Enums.LoadStatusLoading; But is there a similar event in builtin QML-Qt?

Related

Google map features and its cost

We want to make an app where we need to integrate google map. Though we have visited the google web page for knowing the pricing. We want to know If we integrate as it "Standard User" and want to have below feature
As per our understanding - google charges whenever the map is loaded or API is used by the user. Anything above the daily quota of map load has to be paid.
In Zoom feature - will Zoom in and zoom out is treated as two calls.
Similarly, pan feature - will it be treated as map load
Draw circle to create an area on the map to find specific info which is already fed by the user based on the location. Will it also be treated as a call or map load?
In case if user to find location with typing - will the number of characters typed and its search result will be treated as API call for which we have to pay in the case of the above daily quota
I don't know about the last two but the first two are covered in the FAQ for Google Map APIs
After a web page or application loads a map, a static map image, or a Street View panorama, any user interactions with it, such as panning, zooming, or switching map layers, do not generate additional map loads or affect usage limits.

invoke Apple Watch maps app for turn by turn directions

I'm working on a watch app that will amongst other things need to get a person from point A to point B.
one option is to delegate the maps navigation work back to the iPhone and handle messaging updates between the watch and phone etc.
however does anyone know if its possible to simply invoke/launch the Apple Maps app (on the watch) directly from my own watch app and pass the start/end coordinate details -- to automatically initiate turn by turn directions (from the Apple Maps watch app) ?
The second option sounds legit. According to WKInterfaceMap class reference, tapping on the map will directly open the Apple Watch Maps application.
Quoting from the documentation:
A WKInterfaceMap object displays a noninteractive map for the location you specify. Maps must be configured dynamically from your interface controller. Use the methods of the WKInterfaceMap class to specify the visible region of the map and to add any annotations or points of interest. Tapping the map launches the Maps app on the user’s Apple Watch and displays the corresponding location.
Reference: https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceMap_class/index.html

Why EC_DISPLAY_CHANGED is sent even though a monitor change / switch didn't occur?

On the initial graph start, appoxly after 10 video samples, i keep receiving from the GraphManager the EC_DISPLAY_CHANGE event, even though, i didn't physically move the graph from one monitor to another, I only started it on the secondary monitor.
I tried to search for additional information regarding the causes the cause CGraphManager to send it but couldn't find any.
I've additionally used the following code snippet to handle the particular event by myself.
if (FAILED(hr = m_spMediaEventEx->CancelDefaultHandling(EC_DISPLAY_CHANGED)))
return hr;
Thanks for the help
EC_DISPLAY_CHANGE on MSDN:
If the display mode changes, the video renderer might need to choose another format. By sending this message, the renderer signals to the filter graph manager that it needs to be reconnected. During the reconnection, the renderer can select a new format.
The typical scenario is a video renderer expecting to be shown up on primary monitor, and then positioned onto secondary. The renderer generates the event in order to update itself through filter graph transition. You see the event after a few samples are already streamed because the event is handled asynchronously. To work this around, use IVMRMonitorConfig::SetMonitor and friends to position the renderer correctly well in advance.
Note that under normal circumstances, the event and reconnected is just a small delay and should be handled transparently.
By canceling default behavior, you are canceling the following exactly. And you are expected to take care yourself of what default action is trying to fix.
Default Action
The filter graph manager temporarily stops the graph, and then disconnects and reconnects the video renderer. It does not pass the event to the application.

Google Earth Plugin not exact coordinates

I've got quite strange google earth plugin behaviour. I get the camera position from the plugin to create some KML with coordinates, then I store it in database. When I reload the page, then it reads the kml, inserts it inside some other string - as a result I've got a string with whole kml document inside my javascript code. Then I load it into the plugin. Usually everything works, however after loading I see two things:
The coordinates returned by the API are not the same I have in the kml I'm loading
The camera position is sometimes moved a little bit, which causes errors like: I've got a camera inside a building, and after a couple of page refreshing, the camera suddenly is outside the building.
Do you have any hints how this could be fixed?
Example:
I've created a document, and inserted this camera tag inside:
<Camera>
<gx:ViewerOptions><gx:option name='streetview'></gx:option></gx:ViewerOptions>
<longitude>2.1201209999999993</longitude>
<latitude>48.80452499999986</latitude>
<altitude>2.4999999991174264</altitude>
<heading>22.795249807940547</heading>
<tilt>82.25987544961218</tilt>
<altitudeMode>relativeToGround</altitudeMode>
</Camera>
Then I loaded it into the plugin, and asked to fly there. When it stopeed flying, I got the coordinates using copyAsCamera() and the latitude was changed to 48.8044078508718.
The difference is not huge, just 0.000117149 but as a result it is showing a totally different place (a different room in the palace.
I'm trying to get exactly the same place, as written in the coordinates.
I have rewritten the answer to cover the various points you have made and the example you have provided.
street view
The KML data is setting <gx:ViewerOptions> to enter street view mode based on the camera. The key words being based on - a street view is an approximation. Things like the camera tilt and heading are no longer applicable as they are replaced by a SteeetView POV object. Further to that you can't guarantee that a camera at any given latitude and longitude will actually enter street view at the same given latitude and longitude.
relativeToGround and terrain data
Using altitude mode relativeToGround can cause the issue you are seeing. This is because the terrain data hasn't always finished streaming when the relatively positioned element (in your case a camera) is added.
To be clear you should use <altitudeMode>absolute</altitudeMode> and ge.ALTITUDE_ABSOLUTE.
The example you provided uses both <altitudeMode>relativeToGround</altitudeMode> and ge.ALTITUDE_RELATIVE_TO_GROUND.
You could also try disabling the terrain data by turning off the terrain layer, i.e.
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, false);
multiple viewchangeend events
The viewchangeend event may fire in the middle of a viewchange, especially if the plugin pauses for a brief period during the change. Your markup is triggering street view mode which causes this to happen.
You can resolve this by using setTimeout to throttle the viewchangeend event like so.
var timer = null;
google.earth.addEventListener(ge.getView(), 'viewchangeend', function(){
if(timer){
clearTimeout(timer);
}
timer = setTimeout(eventHandler, 100);
}
);
see: https://developers.google.com/earth/documentation/events#event_listeners
Tilt discrepancy
The plugin automatically "swoops" at ground level so that it moves from looking straight down (0 degrees tilt) to straight along the horizon (90 degrees tilt). This is what is causing the discrepancy in the tilt value in the view. You are viewing objects at ground level and so the view is being automatically set - this can't be disabled.
Storing and outputting KML data
Take a look through this document, it gives some really good information of storing coordinate data and covers points like the one I mentioned - A Database Driven Earth App.
.

Google Earth api get coordinates

here goes a simple question:
I've got a showKmz() function which receives an URL belonging to a KML/KMZ file and which goes straight ward to a fetchkml() method, after that it gets appended to my Google Earth instance.
Now I want to recover the coordinates of this fetched KML/KMZ file and use them to immediatelly after load a custom ico I want to put exactly on the same location of the KML/KMZ file I fetched.
The reason for that is that I want to show this files on Google Earth with their clicable icon despite of whatever icon those KML/KMZ could have by default...
Does anybody knows a way to either achieve the goal of retrieving the coordinates or even better: a more direct way to make this custom icon superposing I want?
Thanks in advance!!
Bye!!
From here
http://code.google.com/apis/earth/documentation/kml.html
When getting a KML/Z file with fetchKml, you have in the callback an option to interact with the KMLFeatures you've obtained before appending them to the globe. There could be several items in that file which have coordinates, as well as several icons. So it sounds like you want to get the features, iterate over them, and insert an IconStyle for each (or replace existing IconStyle) to have it render with the Icon you want. You don't have to place a new feature at the same location as the existing ones.

Resources