In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 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 how to write map point aggregation". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
I. Foreword
Query results are usually displayed in the form of marked points on the map, but if there are more marked points, not only will the rendering time of the client be greatly increased, the client will become very stuck, and people will have dense phobia. To solve this problem, we need a way to display the most comprehensive information in the smallest area within the limited visual area of the user, without overlapping coverage. This is the origin of the point aggregation function. Baidu map has a built-in point-like aggregation function. In the early stage of the project, only single-digit devices may need to be displayed on the map. With the increase of the number of devices, it will be found that the labeled points are not only dense but also become more and more stuck. In this way, it is necessary to have a merging function. The points in a certain area are merged into one point icon display. When the user clicks the merged point, he will expand the specific detailed labeled points to monitor the industry. The electricity industry uses it very frequently.
The simplest way to set point aggregation is to convert the incoming label point coordinate set into an array of label point objects. When generating again, you can set the point name, latitude and longitude, and other information. Then instantiate a MarkerClusterer object, and then pass the generated label point object array to this object. We don't need to know the specific point aggregation algorithm. Basically, it is relatively intelligent. When we reduce the map range, we can see that multiple centralized annotation points disappear and become a unified point aggregation icon. Clicking this icon will automatically expand all subordinate annotation points. It is generally recommended to plan which annotation points belong to which point aggregation when setting point aggregation, and try to put them together in one area.
II. Functional characteristics
It supports both online map and offline map modes.
Support webkit kernel, webengine kernel, minilink kernel, IE kernel.
Support setting multiple marking points, including name, address, latitude and longitude.
You can set whether the map can be clicked, dragged, or zoomed with the mouse wheel.
Protocol version, key, theme style, central coordinates, central city, geocode location, etc. can be set.
Map zoom and level can be set, thumbnail, scale, traffic information and other controls visible.
Support map interaction, such as mouse press to get the latitude and longitude of the corresponding position.
Support query route, you can set starting position, ending position, route mode, route mode, route scheme (minimum time, minimum transfer, minimum walking, no subway, shortest distance, avoid highway).
Dot-line-surface tool can be displayed, and lines, dots, rectangles, circles, etc. can be directly drawn on the map.
Administrative divisions can be set, designated a certain city area drawing layer, online map automatically output administrative division boundary point set to js file for offline map use.
Multiple overlays can be added statically or dynamically. Support points, polylines, polygons, rectangles, circles, arcs, point aggregations, etc.
Provide function interface to handle latitude and longitude resolution into address and address resolution into latitude and longitude coordinates.
The demo provided can directly select points to perform corresponding processing, such as route query.
You can get the coordinate information set of the points queried by the route, such as for robot coordinate navigation.
Encapsulates rich functions such as deleting specified points and all points, deleting specified overlays and all overlays, etc.
The label point pop-up box information can be customized in standard html format.
Callout point click event optional 0-Do not process 1-Pop-up box yourself 2-Send signal.
Annotations can be animated 0-Do not handle 1-Jump 2-Fall
Mark points can be set to local picture files, etc.
Function interface friendly and unified, easy to use, on a class.
Support js dynamic interaction to add points, delete points, clear points, reset points, do not need to refresh the page.
Support any Qt version, any system, any compiler.
III. Effect Drawing
void MapBaiDu::getPoints(QStringList &list){ //Convert multiple point coordinates to BMap.Point object //Coordinate format 121.414,31.1828| 121.414,31.1838| 121.416,31.1838 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.