Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Map Mode by Qt

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to achieve map mode in Qt". In daily operation, I believe many people have doubts about how to achieve map mode in Qt. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to realize map mode in Qt". Next, please follow the editor to study!

I. Preface

In addition to the traditional street map map, the default is street map, satellite map, 3D map, etc., in which there are overlay layers, such as overlay road condition layer and road network layer, etc. Recently, I went to the official website of many maps to see the corresponding api interface. On the whole, I feel that they are now moving towards 2.5D or 3D, which is probably a major trend in the future. I remember an older programmer. Spent many years specializing in things like opengl, replaced the existing power grid system with 3D, and even took a high-end name called the World Power Grid Interconnection system, which can directly rotate a sphere and view a variety of power grid routes, etc., and now the security industry seems to be developing towards 3D, even combined with the Internet of things to present a three-dimensional scene of a building or a community in 3D mode. The alarm point is also three-dimensional presentation, this effect is very amazing, accidentally shocked the big leader, and then the funding came.

Baidu map itself provides many kinds of common mode, earth mode, 3D mode, subway mode and so on. Ordinary mode is the most commonly used default, that is, street map and satellite map, while earth mode and 3D mode are newly added in recent years. In order to meet the needs of more and more users, earth mode and 3D mode need to use a new API interface, which starts with BMAP, while it starts with BMAPGL. Even point coordinates and other objects are objects such as BMAPGL.Point, you can see the name of these things are estimated to use things such as opengl to achieve and render.

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::addProperty (QStringList & list) {if (mapType = = 0) {/ / defines the map object 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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report