In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Qt how to write map service". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "Qt how to write map service".
I. Preface
There are basically five domestic map service manufacturers, Baidu Maps, Amap, Tencent Map, Sogou Maps, Sky Maps, and generally Google Maps and Microsoft Maps (BING Maps) abroad. The api interfaces of these mapping services are more or less the same, and even the names of many functions are exactly the same. after all, it is very popular, so it is easy to understand, except for the different JS files introduced into the mapping service. Object names are different, and most of the others are similar, which gives programmers a convenient and unified way of thinking, and the overall process is as follows:
Register the key corresponding to the account application
The secret key can choose the corresponding available features.
Introduce the map JS file, a fixed address with the version and key
Set a div layer object in the body of the web page to store the map
New the map object and set the properties of the map
Setting properties can be either a calling method or a format placement directly similar to json data
Customize the JS function to set other functions to interact with the interface
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 MapGaoDe::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.
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.