I have integrated the turn - turn Navigation with the help of https://github.com/heremaps/here-ios-sdk-examples.
But I am not finding the code as turnManeuver true left -right, speed, locationtname etc as per below image.
I also read this document https://developer.here.com/mobile-sdks/documentation/ios-premium/topics/map-guidance.html. But I am not getting more details of turn left right , speed, time.
Navigation is working fine.
Need to code top bar as write NMAManeuver left, right, name ,distance etc
Need to code bottom bar as speed, time distance
Please provide me some source code which help I can integration as per image. Thanks.
Providing the entire application source for this feature is outside of the scope of StackOverflow. You could request this extension from the HERE team on GitHub. But to get you started, you are already looking in all the right places, it's just a matter of reading a little more documentation.
NMAManeuver left, right, name, distance etc: You can get NMANavigationManager::nextManeuver, the returned NMAManeuver object has all the info you want, e.g. roadName, nextRoadName, distanceFromPreviousManeuver, roadName, ...
speed, time distance: See NMANavigationManager::averageSpeed, timeToArrival, distanceToDestination
More Info:
NMANavigationManager API Reference
NMAManeuver API Reference
Related
Im generating a map proceduraly with isometric autotiles. Each tile has its navigation poligon defined in the Tilemap editor. The Navigationmesh is working fine. The thing is that the map I generate is bigger than the actually playable area. I dont want the human player to see the borders of the map, the "black background". So I'm limiting the camera view movement. Therefore, the navigationmesh goes outside of the playable area, like in this image:
I'm using pathfinding to move the player character. Since the map is generated proceduraly, sometimes it generates a map where the path to a point goes outside the playable area an then comes back in order to reach its destination. Like this:
A player in O would go outside the playable are to reach X. In X could be a point of interest, so if this kind of map is generated, I would simply regenerate it until i get a feasible one.
I'm using GODOT 3.51.
I have think about:
Carving a hole in the navigation mesh on the borders of the playable area using clip_polygons(). BUT since im using autotile navigation, it is very hard to get the navigationpoligoninstance. I have tried this but failed miserably.
-Adding NavigationObstacles on the borders: Hadn't tried this, but as far as i understand from my research, this will not avoid the agent to generate the path to the destination.
My idea is to achieve that no path goes out of the playable area and then check is the map is feasible by checking if all points of interest (randomly spawned) are reacheable. This is done by cheking the last point of every path to interest points from the starting point an seeing if it is equal to the point of interest position.
I hope this is understandable. Sometimes I dont understand myself.
What comes to mind is to use two versions of the tiles. One that is not passable which will be used to generate the areas that the players should not be able to reach. And the regular one used for the playable area.
I saw in version 3.00 there is something called setDataCleaningThreshold , Can you tell its benefits , I think it's for faster loading of progressive charts.
const dcThreshold = xVal - 100;
lineSeries.setDataCleaningThreshold(dcThreshold);
AreaRangeSeries.setDataCleaningThreshold(dcThreshold); // not working
But it's not working for Area range series.
Also there is setMaxPointCount in Area range Series , what is the difference between both ?
My charts are progressive and I want to clear the charts that are out of view and make the charts faster.What is the best way ? Can I use Dispose method ?
Also , can we drag the chart by left click + mouse drag. . I saw something like API for Axis mouse and touch events is released.Can you tell what can be achieved with this.
(right now its right click + drag).
it's not working for Area range series.
setDataCleaningThreshold is new API that will be slowly introduced to existing series. With v3.0 it is only introduced for LineSeries and its derivatives (like PointLineSeries).
To prevent confusion, please refer to official API documentation to see if some method is supported - for example if we look at AreaSeries, it is not part of the API.
Also there is setMaxPointCount in Area range Series , what is the
difference between both ?
setMaxPointCount and setDataCleaningThreshold exist for the same purpose, and effectively achieve the same things, but they are based on slightly different ideas.
setMaxPointCount configures automatic data cleaning by specifying amount of data points to retain at the "head" of data.
setDataCleaningThreshold configures automatic data cleaning by specifying a coordinate on progressive axis. All data points that are "behind" this coordinate can be cleaned whenever convenient. This configuration is slightly preferred over "max points count" as it is more convenient for the rendering engine, and it also behaves slightly more logically - if you apply the fit() operation by dragging to top-left in chartXY with left mouse click, the axis will stop at data cleaning threshold, instead of showing all data including the data behind cleaning threshold.
Both of these methods will be supported for the time being and there should not be major differences between using either, so I recommend use whichever you feel more comfortable with.
Eventually the data cleaning configuration will settle down to a simpler API, but now we're still feeling how different users are using the library, and how we can optimize the performance best - so the API is a bit messy (as in, there are 2 methods for same purpose).
My charts are progressive and I want to clear the charts that are out
of view and make the charts faster.What is the best way ?
For AreaSeries setMaxPointCount is the only automatic option.
Please see the updated documentation on the method to learn more.
You can also implement manual data cleaning using dispose method, as you suggested.
However, please see if automatic data cleaning works for you first.
I am new to Here-API and have been struggling for a couple of days. I want to achieve something like this but a bit cleaner. I do not want to plot the point on the map. All I want is to retrieve the speed limit. I have tried a couple of things like this, this. A humble request to please add demo get requests and not just the procedure.
Note: I only have an API Key, I am not looking for android/ios code. Just a demo Get request should be fine. I do not have app-code, app-id as I have a freemium subscription.
The easiest way to find out what you want to know is to watch what happens when you input coordinates and press the Load button.
Using the Chrome browser, log in and go to the page.
Select Menu > More Tools > Developer Tools.
Click Network at the top of the screen.
Type in street coordinates and press Load.
What you see on the right side are the queries and results. The one you're interested in begins with:
https://reverse.geocoder.api.here.com/6.2/reversegeocode.json? [continues]
Look at the return value of that call to get your results. The other queries are for the graphical display, so you don't need those.
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.
.
My webpage displays runtime generated FusionTables data on a Google Map.
The problem is: when you create a FusionTable with geometry type column and display it for the first time, Google has to load all related map tiles in its server side cache. This takes a while - sometimes 2-3 sec, sometimes 15 -20 sec.
During caching, the map should display a grey overlay saying "Data may still be loading...". I'd like to avoid this screen, because it's very buggy. Sometimes the overlay is displayed, sometimes not.
I'm looking for a way to detect if all map tiles cached so that i can display the map to the user.
I already tried to refresh the map tiles periodically, but this will give me no feedback when to stop refreshing:
$("img[src*='googleapis']").each(function(){
$(this).attr("src",$(this).attr("src")+"&"+(new Date()).getTime());
});
For this reason I'm looking for other solutions.
Try simplifying your geographic data. The message appears when the server-side process misses a deadline for serving the map tile in a reasonable time. By reducing the complexity of the polygons, you're much more likely to not see the "Data may still be loading...." message tiles.
You can reduce the complexity in two ways: reduce the number of vertices (points) that define the polygons, and reduce the precision of the lat/long locations.
Please also note as an FYI that as the exact same map gets called again and again by different viewers, the process results are cached server-side and the message becomes much less likely to appear, and then usually due to public cacheing.
-Rebecca
Answering my own question: simply there's no way to do it as of now.
As a sidenote: I'd never advise anyone to think about using FusionTables to display dynamically generated geographic data. It's not designed that way. Only use FT if you have a somewhat static dataset that changes rarely.