In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 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 "Qt Map Route query case Analysis". In the operation of the actual case, many people will encounter such a dilemma, 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
The function of route query is only available on the online map, because this route planning needs to be updated frequently, and this data synchronization requires a lot of manpower and material resources to count, so this thing must be placed on the server side. Even if it is placed locally offline like the mobile end, it also needs to be updated after a period of time, otherwise the data may not be correct. Route inquiry, also known as travel planning, is basically divided into two categories, one is driving and the other is not driving, in which drivers have a variety of strategies to choose from, such as minimum time, shortest distance, avoiding highways, and so on. Those who do not drive also have a variety of strategies to choose from, such as minimum time, minimum transfer, least walking, not taking the subway. The function of route query now seems to only support longitude and latitude as a parameter by default. In the past, you can directly enter Chinese names, such as house number, and so on. This kind of address resolution or reverse resolution function needs to be activated with the corresponding secret key in the background.
Yesterday, I reorganized the function of path planning, and found that two path planning methods of walking and cycling were added to the official website, so I feel more and more that there are many advantages of running on the server, and the server program can be constantly optimized and updated. in this way, users have no perception and no impact, and unwittingly use the latest programs and services. Therefore, in the program development, we often encounter the processing choice of the client or the server, of course, the client also has the benefits of the client.
II. Functional features
Both online map and offline map modes are supported.
Support webkit kernel, webengine kernel and IE kernel at the same time.
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.
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 ()) {/ / address indicates 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.