In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to compile a map to achieve path planning in Qt". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
I. Preface
Recently, the comprehensive application of this map has been greatly improved, updated and upgraded, including many improvements and adjustments using examples, including the function of path planning. Previously, only the JS interface of Baidu Map was called to query the appropriate route according to the latitude and longitude of the coordinates of the starting point and the coordinates of the end point, but did not get the track point coordinates of the queried path. For other processing, such as sending it to the robot, let the robot move according to this track point, in order to ensure that the coordinate set of the track points is correct, the track points can also be redrawn with different colors, and compared with the track lines obtained by the query route, the high coincidence shows that it is correct.
With regard to the starting and ending coordinates, the first thing to do is to pass in the specific Chinese address directly. After Baidu Map, this function is no longer open, which seems to have become a charging function, but the function of longitude and latitude and address conversion is still open. so there is one more step, and what we do later is to query the longitude and latitude coordinates directly, which needs to be entered manually, and what we do now is to select points directly on the map. Select the points in the radio box after the starting coordinates, and then select the points directly on the map, and the corresponding longitude and latitude coordinates will be filled in automatically, which is relatively more humane.
Get the track point coordinate set to draw, in fact, the call is the addPolyline function to draw, note that the received track point coordinate set is likely to be multi-segment, rather than a complete segment, passed through the array array, so you need to make a loop to draw the received path point set line segments, as for the line color + border + transparency can be set in order to distinguish the original path query drawn automatically.
II. Functional features
Both online map and offline map modes are supported.
It also supports webkit kernel, webengine kernel, miniblink kernel and IE kernel.
Multiple dimension points can be set, including name, address, longitude and latitude.
You can set whether the map can be clicked, dragged, or scrolled.
You can set the protocol version, secret key, theme style, central coordinates, central city, geocoding location, and so on.
Can set the map zoom scale and level, thumbnails, scale, road information and other controls visible.
Support map interaction, such as mouse press to get the latitude and longitude of the corresponding location.
Support to query the route, you can set the starting point, end point, route mode, route mode, route scheme (minimum time, least transfer, least walk, do not take the subway, shortest distance, avoid highway).
Can display dots, lines and surfaces tools, and can draw lines, points, rectangles, circles and so on directly on the map.
Administrative divisions can be set up, a certain urban area drawing layer can be specified, and the online map automatically outputs the administrative division boundary points to the js file for offline map use.
Multiple coverings can be added statically or dynamically. Support points, broken lines, polygons, rectangles, circles, arcs, point aggregations, etc.
Provides a function interface to handle latitude and longitude resolution to address and address resolution to latitude and longitude coordinates.
The demo provided can be directly selected to perform corresponding processing such as route query.
You can get the collection of point coordinate information queried by the route, such as for robot coordinate navigation.
Encapsulates a wealth of functions such as deleting specified points and all points, deleting specified coverings and all coverings, etc.
Callout point pop-up box information can be customized in standard html format.
Dimension point click event optional 0-do not process 1-own pop-up box 2-send a signal.
Dimension points can be animated 0-do not process 1-Jump 2-fall
Dimension points can be set up local picture files and so on.
The function interface is friendly and unified, and it is easy to use, just one class.
Support js dynamic interaction to add points, delete points, clear points, reset points, no need to refresh the page.
Support any Qt version, any system, any compiler.
Third, effect picture
4. The related code void MapBaiDu::addRoute (QStringList & list) {if (startAddr.isEmpty () | | endAddr.isEmpty ()) {return;} / / is in the address, indicating the latitude and longitude form if (startAddr.contains (",")) {list.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.