In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how QT compiles maps to achieve online contours. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I. Preface
The outline map here refers to the regional outline map of Baidu map, which is not the echart-specific outline map mentioned in the previous article. The outline map of Baidu map is an irregular polygonal area, but there are generally many coordinate points in this area. For example, the regional outline of a county and city can get a series of coordinate points, which are mainly used to highlight a certain area. For example, this area can highlight the color display, and the color, thickness and transparency of the lines can be set.
The online outline can be obtained directly by calling the Boundary.get method built into the map. You only need to specify the name of the region, such as Shanghai, and you can get all the coordinate points of the corresponding region in the callback function, which is very convenient to use. This function is built into the map, and the algorithm is not found in the offline map class. The specific execution rules may be stored on the server and are constantly updated. For example, administrative areas across the country are not immutable and will change.
One point that should be noted in the outline map is that the outline map of each region may not be an area, and there are enclaves in many places, or several larger areas. For example, in Shanghai, in addition to the Shanghai base camp, there is also most of Chongming Island, so when drawing, we must pay attention to the collection of multiple coordinate points.
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, experience address
Experience address: https://pan.baidu.com/s/1ZxG-oyUKe286LPMPxOrO2A extraction code: o05q file name: bin_map.zip
Domestic site: https://gitee.com/feiyangqingyun
International site: https://github.com/feiyangqingyun
4. Effect picture
The related code void MapBaiDu::addBoundary (QStringList & list) {/ / defines the array to store draggable boundary points / / defined here, in the list called by the getBoundary function
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.