CN112395375B - Map presentation method, terminal and computer readable storage medium - Google Patents

Map presentation method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN112395375B
CN112395375B CN201910754851.8A CN201910754851A CN112395375B CN 112395375 B CN112395375 B CN 112395375B CN 201910754851 A CN201910754851 A CN 201910754851A CN 112395375 B CN112395375 B CN 112395375B
Authority
CN
China
Prior art keywords
map
current
previous
range
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910754851.8A
Other languages
Chinese (zh)
Other versions
CN112395375A (en
Inventor
赵胜
茆玉庭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910754851.8A priority Critical patent/CN112395375B/en
Publication of CN112395375A publication Critical patent/CN112395375A/en
Application granted granted Critical
Publication of CN112395375B publication Critical patent/CN112395375B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Remote Sensing (AREA)
  • Instructional Devices (AREA)
  • Navigation (AREA)

Abstract

The embodiment of the invention discloses a map presentation method, a terminal and a computer readable storage medium, comprising the following steps: receiving a map presentation operation on a display interface of a previous map; acquiring a previous view range corresponding to a previous map, and determining a current view range and a preset map base map corresponding to the current view range according to the previous view range and the map presentation operation; determining data to be loaded according to the current view range; pre-rendering the data to be loaded to obtain map elements; and correspondingly drawing the map elements on the preset map base map to obtain a current map and displaying the current map. Therefore, only the data to be loaded corresponding to the current view range can be rendered, the data quantity to be rendered is reduced, only a small amount of rendered map elements are required to be stored in the memory, the memory consumption is reduced, the influence on the system processing speed is reduced, and the instantaneity is improved.

Description

Map presentation method, terminal and computer readable storage medium
Technical Field
The present invention relates to electronic map technology, and in particular, to a map presenting method, a terminal, and a computer readable storage medium.
Background
Electronic maps refer to maps that are stored and referred to in digital form using computer technology. The mainstream electronic map presentation technique includes: internet map presentation technology and map engine technology. The internet map rendering technique renders and renders an internet map in the front end of a web page by invoking the internet map and its application programming interface (Application Programming Interface, API) by introducing an accessed map portal. The map engine technology provides a series of realization and interfaces of specific bottom layer functions, and the upper layer map application obtains a processed element map layer by calling the function interfaces provided by the map engine so as to finish the presentation of the map.
However, when the internet map presentation technology is used for drawing the front end, the acquired map data is stored in the front end memory, and at the moment, a large amount of memory resources are required to be consumed, the processing speed of the system is slowed down, and the instantaneity is affected; when the map engine technology presents the map, map data are needed to be obtained first, then the map data are rendered in batches, and after the rendering is finished, the map engine loads a required map layer on the base map so as to complete the presentation of the map, the processing time is long, and the instantaneity of map loading is affected.
Disclosure of Invention
The embodiment of the invention provides a map presentation method, a terminal and a computer readable storage medium, which can reduce the data volume to be processed, improve the real-time performance of map presentation and improve the overall performance of a system.
The technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a map presenting method, including:
receiving a map presentation operation on a display interface of a previous map;
acquiring a previous view range corresponding to a previous map, and determining a current view range and a preset map base map corresponding to the current view range according to the previous view range and the map presentation operation;
determining data to be loaded according to the current view range;
pre-rendering the data to be loaded to obtain map elements;
and correspondingly drawing the map elements on the preset map base map to obtain a current map and displaying the current map.
In the above solution, the obtaining a previous view range corresponding to a previous map, and determining, according to the previous view range and the map presenting operation, a current view range and a preset map base map corresponding to the current view range include:
Acquiring a previous view level and a previous center position corresponding to the previous view range based on the previous view range;
determining a current view level by using the map presentation operation and the previous view level, and determining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range;
determining a current center position according to the map presentation operation and the previous center position;
and determining the current view range by utilizing the current center position and the current loading range, and acquiring the preset map base map corresponding to the current view range.
In the above solution, the determining, by using the map presenting operation and the previous view level, the current view level, determining the current view level, and determining, according to a correspondence between a preset view level and a loading range, a current loading range corresponding to the current view level includes:
when the map presenting operation is a zooming operation, acquiring a zooming level of the map presenting operation; determining the current view level by using the previous view level and the zoom level, and obtaining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range;
And when the map presenting operation is a dragging operation, determining the previous view level as the current view level, and obtaining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and a loading range.
In the above aspect, the determining the current center position according to the map presenting operation and the previous center position includes:
when the map presenting operation is a zooming operation, determining the previous center position as the current center position;
when the map presenting operation is a drag operation, acquiring a moving distance of the map presenting operation; and determining the current center position according to the previous center position and the moving distance.
In the above scheme, the drawing the map elements on the preset map base map correspondingly, obtaining the current map and displaying the current map includes:
acquiring position information corresponding to the map elements;
determining a preloading position on the preset map base map according to the position information;
and drawing the map element on the preloaded position, obtaining the current map and displaying the current map.
In the above scheme, after the map elements are correspondingly drawn on the preset map base map to obtain the current map and display the current map, the method further includes:
acquiring a current view level, and determining a preloading offset of the current view range according to a preset relationship between the view level and the loading offset;
determining a preloaded view range according to the current view range and the preloaded offset;
according to the preloaded view range, a preloaded base map corresponding to the preloaded view range is obtained, and preloaded data corresponding to the preloaded view range is obtained from the map database;
and pre-rendering the pre-loaded data to obtain a pre-loaded element, and correspondingly drawing the pre-loaded element on the pre-loaded base map.
In the above scheme, the determining the data to be loaded according to the current view range includes:
according to the current view range, map data corresponding to the current view range is obtained from a map database and used as the data to be loaded; or alternatively, the process may be performed,
and determining the data to be loaded according to the current view range and the previous view range.
In the above solution, the determining the data to be loaded according to the current view range and the previous view range includes:
acquiring map data corresponding to the previous view range, a previous view level corresponding to the previous view range, and a current view level corresponding to the current view range;
when the current view level is smaller than the previous view level, determining map data corresponding to the previous view range as the data to be loaded;
when the current view level is not smaller than the previous view level, acquiring map data corresponding to the current view range from the map database according to the current view range; and determining the data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range.
In the above solution, the determining the data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range includes:
intersection of the map data corresponding to the previous view range and the map data corresponding to the current view range is obtained, and intersection map data is obtained;
And removing the intersection map data from the map data corresponding to the current view range, and taking the rest map data as the data to be loaded.
In the above aspect, when the display interface of the previous map is the display interface of the initializing map, before receiving the map presenting operation on the display interface of the previous map, the method further includes:
acquiring a preset initialization map base map and a preset initialization view range, and acquiring initialization loading data from a map database according to the preset initialization view range;
pre-rendering the initialization loading data to obtain an initialization element;
and correspondingly drawing the initialization elements on the preset initialization map base map to obtain and display an initialization map.
In a second aspect, an embodiment of the present invention provides a terminal, including:
the receiving module is used for receiving map presentation operation on a display interface of a previous map;
the acquisition module is used for acquiring a previous view range corresponding to a previous map;
the determining module is used for determining a current view range and a preset map base map corresponding to the current view range according to the previous view range and the map presenting operation; determining data to be loaded according to the current view range;
The processing module is used for prerendering the data to be loaded to obtain map elements; drawing the map elements on a limited preset map base map to obtain a current map;
and the display module is used for displaying the current map.
In a third aspect, an embodiment of the present invention further provides a terminal, including: a memory and a processor;
the memory is used for storing executable map presentation instructions;
the processor is configured to execute executable map presentation instructions stored in the memory, and implement the method according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where executable map presentation instructions are stored, for causing a processor to execute the method according to any one of the first aspect.
By adopting the implementation manner, the data to be loaded can be determined according to the current view range in the map presentation process, and then only the data to be loaded is prerendered, so that the data quantity to be rendered is reduced, the rendering processing speed is accelerated, only a small amount of map elements which are subjected to rendering are required to be stored in the memory after the prerendered map elements are obtained, the memory consumption is reduced, the influence on the system processing speed is reduced, and the instantaneity of map presentation is improved.
Drawings
Fig. 1 is a flowchart of a map presenting method according to an embodiment of the present invention;
fig. 2 is an exemplary diagram of a map presenting method according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a map presenting method according to an embodiment of the present invention;
fig. 4 is a flowchart III of a map presenting method according to an embodiment of the present invention;
fig. 5 is a flowchart of a map presenting method according to an embodiment of the present invention;
fig. 6 is a flowchart fifth of a map presenting method according to an embodiment of the present invention;
fig. 7 is a flowchart sixth of a map presenting method provided in an embodiment of the present invention;
fig. 8 is a flowchart seventh of a map presenting method provided in an embodiment of the present invention;
fig. 9 is a flowchart eight of a map presenting method provided in an embodiment of the present invention;
fig. 10 is a flowchart nine of a map presenting method provided in an embodiment of the present invention;
FIG. 11 is a schematic process diagram of a map presenting method according to an embodiment of the present invention;
fig. 12 is a flowchart tenth of a map presenting method provided by an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 14 is a schematic diagram of a composition structure of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Electronic maps are maps stored and referred to in digital form using computer technology. The mainstream electronic map technology includes: internet map presentation technology and map engine technology.
Internet map rendering technology generally introduces a map portal by calling an internet map and an application programming interface (Application Programming Interface, API) thereof, calls background map data through the map portal when using the map, and then renders the map data by a front end to render the map. The internet map can provide rich map service modes, such as vector map, satellite map, three-dimensional map and the like, and can be suitable for various application scenes through the rich map service modes. Because different projection technologies, coordinate systems and longitude and latitude coding modes are adopted, different internet maps exist, such as a hundred-degree map, a google map, a sky map, a map and the like are common internet maps, however, in actual use, for the same geographic area, some differences may exist in display details of the maps. When storing map data, the internet map stores space coordinate data and attribute data in a database according to an object-oriented mode based on an object relation model, and the space coordinate data and the attribute data jointly form the map data. When the internet map is presented, the front end firstly acquires map data from the database, namely acquires space coordinate data and attribute data corresponding to the space coordinate data, stores the map data into the memory of the front end, and then renders and draws the map data, at the moment, more front-end memory is consumed, the processing speed of a system is slowed down, and the real-time performance of map presentation is affected.
Map engine technology provides a series of implementation and interfaces for specific functions with which a specific map application can be built at the top level of the map engine. The element service provided by the map engine technology can process map data in advance and store the processed data in a specific database, so that point data, line data and surface data in the map data can exist in the form of elements, and when the front end loads the map data on a base map, the processed elements are called to load, so that the time for rendering the map data one by the front end can be reduced. Meanwhile, the map engine technology not only carries a basic map base map, but also provides an access scheme of a third-party map base map, and is convenient for development of upper-layer application. Although the map engine technology has a certain advantage in map presentation, in a specific map presentation process, the map engine needs to obtain map data first, then perform batch rendering on all obtained map data, and draw a prime layer on the map after the rendering is finished so as to complete map presentation.
Based on the problems of the two map presentation technologies, the basic idea of the embodiment of the invention is to reduce the amount of map data to be rendered as much as possible when presenting the map so as to improve the real-time performance, and simultaneously, when the front end is drawn, only a small amount of rendered elements are required to be stored in the memory, thereby reducing the influence on the processing speed of the system and further improving the real-time performance.
Example 1
Based on the foregoing ideas of the embodiments of the present invention, the embodiments of the present invention provide a map presenting method, which may be applied to a map engine, referring to fig. 1, and the method may include:
s101, receiving map presentation operation on a display interface of a previous map.
The map presentation method provided by the embodiment of the invention is realized in a scene of presenting the electronic map on the terminal. In the embodiment of the invention, the terminal displays the previous map on the display interface, when the user performs the map presentation operation on the display interface of the previous map, the terminal indicates that the display range of the map needs to be changed, namely, the previous map is changed into the current map, and at the moment, the terminal receives the map presentation operation and determines the current view range according to the previous map and the received map presentation operation.
The display interface of the previous map in the embodiment of the invention refers to the last map display interface displayed on the terminal before receiving the map presentation operation. For example, when the map display terminal receives a map presentation operation at the current time, the previous map refers to the last map displayed by the terminal before the current time.
It should be noted that, each time a map presenting operation is received, the terminal is triggered to change the view range of the map, so the last map display interface displayed on the terminal may be the last map interface triggered to be displayed by the previous map presenting operation before receiving the map presenting operation at the current moment, or may be the initial map interface displayed on the display interface when no map presenting operation is received yet.
In the embodiment of the present invention, the view range refers to the latitude and longitude range of the map to be displayed on the terminal.
In the embodiment of the invention, the map presenting operation refers to an operation capable of triggering to change the map presenting range. Alternatively, the map presenting operation may be a drag operation, or may be a zoom operation.
It should be noted that, the terminal in the embodiment of the present invention may be a terminal with a function of receiving a map presentation operation and a display function, such as an intelligent mobile terminal, an iPad, a personal computer, etc., and the embodiment of the present invention is not limited herein.
Optionally, the terminal in the embodiment of the present invention may receive the map presenting operation through a touch screen, or may receive the map presenting operation through an external device such as a mouse or a keyboard.
S102, acquiring a previous view range corresponding to a previous map, and determining a current view range and a preset map base map corresponding to the current view range according to the previous view range and map presentation operation.
After receiving the map presenting operation, the terminal acquires a previous view range corresponding to a previous map, and determines a current view range and a preset map base map corresponding to the current view range according to the acquired previous view range and the map presenting operation, so that the subsequent terminal can determine data to be loaded according to the current view range.
In the embodiment of the present invention, the previous view range refers to the latitude and longitude range of the previous map displayed on the display interface of the terminal.
After obtaining the previous view range, i.e. the latitude and longitude range of the previous map displayed on the display interface, the terminal can determine the current view range according to the latitude and longitude range of the previous map and the map presenting operation. The current view range refers to the latitude and longitude range of the current map to be presented, which is triggered by the map presenting operation at the current time.
Specifically, the terminal may acquire a previous view level based on a previous view range, and a previous center position corresponding to the previous view range; determining a current view level by using map presentation operation and a previous view level, and determining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range; determining a current center position according to the map presentation operation and the previous center position; and determining a current view range by using the current center position and the current loading range, and acquiring a preset map base map corresponding to the current view range.
It should be noted that, in the embodiment of the present invention, the preset map base map refers to a layer for displaying basic geographic information. The basic geographic information refers to information such as topography, hydrologic distribution, building shape and the like.
For example, when the terminal needs to present a map of a city, only a map layer of information about street network distribution, building shape, river distribution in the city, and the like is displayed on the display interface of the terminal, which is a base map of the map to be presented.
Alternatively, the preset map base map may be pre-stored in the terminal, or may be obtained from a third party map base map by the terminal, which is not limited herein.
The preset map base map may be a map base map obtained by the terminal from the map.
S103, determining data to be loaded according to the current view range.
After determining the current view range, namely the latitude and longitude range of the map to be presented, the terminal can determine the data to be loaded according to the latitude and longitude range, and then the terminal can process the data to be loaded.
Optionally, in the embodiment of the present invention, when determining the data to be loaded, the terminal may obtain, from the map database, map data corresponding to the current view range as the data to be loaded according to the current view range; or determining the data to be loaded according to the current view range and the previous view range.
The map data refers to the stored spatial coordinate data and attribute data in an object-oriented manner. The space coordinate data is longitude and latitude coordinates, the attribute data is data for storing attribute information, and the data can be used for indicating data types, storing data names and the like. For example, when there is one parking lot at a certain geographical location, the spatial coordinate data is the latitude and longitude coordinates of the geographical location, the attribute data is category information indicating that the geographical location is the parking lot, and the stored parking lot name.
Since each map data has space coordinate data indicating a geographical position and attribute data corresponding to the space coordinate data when stored, the terminal can acquire the attribute data in the latitude and longitude range from the map database according to the latitude and longitude range of the map to be presented when acquiring the map data from the map database.
Alternatively, the map database in the embodiment of the present invention may be a national basic geographic information database, or may be another database capable of achieving the same purpose, which is not limited herein.
S104, pre-rendering the data to be loaded to obtain map elements.
The data to be loaded obtained by the terminal refers to space coordinate data and attribute data corresponding to the space coordinate data, namely, the terminal obtains a certain longitude and latitude coordinate point and the attribute data corresponding to the longitude and latitude coordinate point, however, when a map is displayed, different types of map data need to be displayed by different symbols, and data names need to be displayed according to a specific format, so that the terminal needs to pre-render the data to be loaded after obtaining the data to be loaded, and the pre-rendered data is used as map elements.
It should be noted that, the terminal in the embodiment of the present invention is applied to the map engine, so that the terminal may call the map engine to pre-render the data to be loaded when pre-rendering the data to be loaded.
Optionally, in the embodiment of the present invention, pre-rendering may refer to classifying all the obtained data to be loaded according to attribute data, and rendering the data of the same class into uniform symbols, so that the map display is more visual and attractive; the pre-rendering can also refer to rendering all the obtained data to be loaded and the names of the data stored in the pre-rendering according to the same format, so that the map display is more attractive.
Alternatively, the map engine in the embodiment of the present invention may be an Arc geographic information system (Arc Geographic Information System, arcGIS), or may be another map engine capable of achieving the same objective, which is not limited herein.
It should be noted that, in the embodiment of the present invention, after the terminal performs pre-rendering on the data to be loaded, the map element is obtained. Because the data to be loaded has the space coordinate data indicating the geographic position, the map elements obtained after the data to be loaded is pre-rendered should also have the space coordinate data indicating the geographic position, namely the longitude and latitude coordinates indicating the geographic position, so that the subsequent map drawing is convenient.
And S105, correspondingly drawing map elements on a preset map base map, obtaining a current map and displaying the current map.
After obtaining the map element, the terminal correspondingly draws the map element on a preset map base map according to longitude and latitude coordinates used for indicating the geographic position in the map element to obtain a current map, and displays the current map on a display interface of the terminal.
Specifically, the terminal may acquire position information corresponding to the map element; determining a preloading position on a preset map base map according to the position information; and drawing the map elements on the preloaded position, obtaining the current map and displaying the current map.
It should be noted that, because the map element has longitude and latitude coordinates indicating the geographic position, when the terminal draws correspondingly, the map element will be drawn at the corresponding coordinates on the preset map base map according to the longitude and latitude coordinates of the map element, so as to complete the drawing of the map, obtain the current map and display.
By way of example, the embodiment of the present invention provides an example of a map presentation method, as shown in fig. 2. In this example, the terminal is a personal computer, the user receives a map presenting operation on the display interface of the previous map by using a peripheral device such as a mouse, and after receiving the map presenting operation, the terminal determines the current view range and a preset map base map corresponding to the current view range according to the previous view range corresponding to the previous map and the map presenting operation, and in fig. 2, the preset map base map is obtained from the map. And the terminal sends a data request to the map database according to the current view range, namely the latitude and longitude range of the map to be presented, and receives the returned data of the map database as the data to be loaded. After the data to be loaded is obtained, the terminal calls the ArcGIS engine, the data to be loaded is rendered, after the map elements are obtained, the terminal correspondingly draws the obtained map elements on a preset map base map obtained from the sum map, and map drawing is completed, so that a current map is obtained and displayed.
In the embodiment of the invention, the terminal can determine the data to be loaded according to the current view range in the map presentation process, then, the terminal only needs to pre-render the data to be loaded, thereby reducing the data quantity to be rendered, accelerating the processing speed of rendering, and after the map elements are obtained through pre-rendering, the terminal only needs to store a small quantity of map elements which are rendered in the memory, thereby reducing the consumption of the memory, reducing the influence of the memory consumption on the processing speed of the system and improving the instantaneity of map presentation.
Example two
Based on the same inventive concept as that of the first embodiment, referring to fig. 3, in the first embodiment, a previous view range corresponding to a previous map is acquired, and according to the previous view range and the map presenting operation, the determining a current view range and a preset map base map corresponding to the current view range, that is, the specific implementation process of S102 in the first embodiment may include: S1021-S1024 as follows:
s1021, based on the previous view range, acquiring the previous view level and the previous center position corresponding to the previous view range.
Since the terminal can cache the related content of the previous map into the terminal after the previous map is displayed, the terminal can acquire the previous view range corresponding to the previous map in the storage space of the terminal, acquire the previous view level corresponding to the previous view range and the central position corresponding to the previous view range, namely the previous central position according to the acquired previous view level, the previous central position and the map presentation operation, and determine the current loading range corresponding to the current view level and the current central position.
In the embodiment of the invention, the previous view level refers to the level of the scale of the previous map when the previous map is displayed, and the previous center position corresponding to the previous view range refers to the longitude and latitude coordinates located at the center of the previous view range.
It should be noted that, the larger the view level is, the larger the scale is, and the smaller the latitude and longitude range of the loaded map is on the same display interface, the finer the map display is; the smaller the view level is, the smaller the level of the scale is, the smaller the scale is, and the larger the latitude and longitude range of the loaded map is on the same display interface, the more simple the map is displayed.
Alternatively, in the embodiment of the present invention, the view layer may be divided into 20 levels, which respectively correspond to different scale levels, or may be classified into view layers according to other methods according to actual situations, which is not limited herein.
S1022, determining a current view level by using the map presenting operation and the previous view level, and determining a current loading range corresponding to the current view level according to the corresponding relation between the preset view level and the loading range.
Because different view levels correspond to different map latitude and longitude loading ranges, the terminal must determine the current view level before determining the current view range. After the terminal acquires the previous view level, the terminal needs to determine the current view level by utilizing the received map presentation operation and the acquired previous view level, and determine the current loading range corresponding to the current view level according to the corresponding relation between the preset view level and the loading range.
It should be noted that, in the embodiment of the present invention, the map presenting operation may be a drag operation or a zoom operation, however, different determining manners of the current loading range may be different due to different map presenting operations, so that it is necessary to determine the corresponding current loading range according to the map presenting operation, specifically, the drag operation or the zoom operation, respectively.
Specifically, referring to fig. 4, in the embodiment of the present invention, by using the map presenting operation and the previous view level, the current view level is determined, and the current loading range corresponding to the current view level is determined according to the corresponding relationship between the preset view level and the loading range, which may be determined according to S1022a-S1022b, as follows:
S1022a, when the map presenting operation is a zooming operation, acquiring a zooming level of the map presenting operation; and determining the current view level by utilizing the previous view level and the zoom level, and obtaining the current loading range corresponding to the current view level according to the corresponding relation between the preset view level and the loading range.
When the terminal receives the map presenting operation and judges that the map presenting operation is a zooming operation, the current view level can be determined according to the zooming level and the previous view level. After the terminal determines the current view level, the loading range corresponding to the current view level, namely the current loading range, can be determined from the corresponding relation between the view level and the loading range.
In the embodiment of the invention, the terminal may determine whether the map presenting operation is a zoom operation according to whether the number of finger contact points on the touch screen is 2 or not, or according to whether the mouse is operated by a roller. Of course, other manners may be used to determine whether the map presenting operation is a zoom operation, and embodiments of the present invention are not limited herein.
In the embodiment of the invention, the zoom level refers to a magnification or a reduction multiple of the display content in the display interface, which is determined by the zoom operation.
For example, when the terminal receives a map presenting operation and determines that there are 2 finger contact points on the touch screen of the terminal, the map presenting operation is determined to be a zoom operation, and at this time, the zoom level may be a ratio of a distance between 2 finger contact points on the touch screen at the beginning of the zoom operation to a distance between 2 finger contact points on the touch screen at the end of the zoom operation, as the zoom level; the zoom level may also be determined based on the distance the mouse wheel is rolled forward, or the distance it is rolled backward.
It should be noted that, the current view level refers to a scale level that the current map should have. Since the terminal has obtained the previous view level, i.e. the level of the scale of the previous map when displayed, and the zoom level, i.e. the magnification or reduction factor, the terminal can multiply the previous view level with the zoom level to determine the current view level.
In the embodiment of the invention, the corresponding relation between the preset view level and the loading range can be set according to the actual requirement and is stored in the terminal in advance.
The current loading range refers to a latitude and longitude interval range that can be loaded on the display interface when the map is presented, and indicates a range that can be loaded by longitude and latitude from a latitude and longitude coordinate point located at the center of the display interface.
And S1022b, when the map presenting operation is a dragging operation, determining the previous view level as the current view level, and obtaining the current loading range corresponding to the current view level according to the corresponding relation between the preset view level and the loading range.
When the terminal receives the map presenting operation and judges that the map presenting operation is a drag operation, the drag operation only drags the view window to move and does not involve the enlargement or reduction of the display content, so that the terminal directly takes the previous view level as the current view level, and then obtains the current loading range by utilizing the current view level and the corresponding relation between the preset view level and the loading range.
Optionally, in the embodiment of the present invention, the terminal may determine whether the received map presenting operation is a drag operation according to whether the number of finger contact points on the touch screen is 1 or not, or according to whether the mouse performs a drag operation by using a key, or of course, whether the map presenting operation is a drag operation may also determine whether the map presenting operation is a drag operation according to other manners, which is not limited in detail herein.
When the map presenting operation receives the map presenting operation and judges that the touch screen of the terminal has 1 finger contact point, the terminal judges the map presenting operation as a drag operation and directly determines the previous view level as the current view level.
The terminal thus completes the process of determining the current loading range using the map rendering operation and the previous view level.
S1023, determining the current center position according to the map presenting operation and the previous center position.
After determining the loading range, the terminal must also know the center position of the view range to determine the view range. Thus, the terminal needs to determine the position at which the center of the current view range is located, i.e., the current center position, based on the map presenting operation and the previous center position.
It should be noted that, the map presenting operation may be a drag operation or a zoom operation, however, different map presenting operations may bring different effects to the current center position, and thus, it is necessary to determine the corresponding current center position according to the map presenting operation, specifically, the drag operation or the zoom operation, respectively.
Specifically, referring to fig. 5, in the embodiment of the present invention, the current center position is determined according to the map presenting operation and the previous center position, and may be determined according to S1023a-S1023b, as follows:
s1023a, when the map presenting operation is a zoom operation, determining the previous center position as the current center position.
Since the zoom operation causes enlargement or reduction of the display content without causing movement of the center position of the view window, when the terminal receives the map presentation operation and determines that the map presentation operation is the zoom operation, the previous center position is directly determined as the current center position.
It should be noted that, since the previous center position refers to the latitude and longitude coordinates located at the center of the previous view range, the current center position determined by the previous center position refers to the latitude and longitude coordinates located at the center of the current view range.
S1023b, when the map presenting operation is a drag operation, acquiring a moving distance of the map presenting operation; and determining the current center position according to the previous center position and the moving distance.
When the terminal receives a map presenting operation and judges that the map presenting operation is a drag operation, the terminal needs to acquire the moving distance of the map presenting operation, namely the moving distance of the drag operation, sum the previous center position and the moving distance, and take the obtained sum result as the current center position.
In the embodiment of the invention, the moving distance refers to the latitude and longitude distance deviated from the previous center position triggered by the drag operation.
In addition, when the terminal is in the drag operation, the terminal can obtain the pixel distance moved by the drag operation on the display interface, and when the map is presented on the display interface, the longitude and latitude of the map have a corresponding relationship with the pixels of the display interface, so that the terminal can necessarily determine the longitude and latitude distance offset from the previous center position according to the corresponding relationship after obtaining the pixel distance moved by the drag operation.
The terminal completes the process of determining the current center position according to the map presenting operation and the previous center position.
S1024, determining a current view range by using the current center position and the current loading range, and acquiring a preset map base map corresponding to the current view range.
After the terminal obtains the current center position and the current loading range, the terminal can determine the current view range according to the current center position and the current loading range, namely the latitude and longitude range of the current map to be displayed, and obtain the preset map base map corresponding to the current view range according to the latitude and longitude range.
In the embodiment of the invention, the terminal can acquire the previous view level and the previous central position corresponding to the previous view range, then the current view level is determined by utilizing the previous view level and the map presentation operation, the current loading range is further determined, the current central position is determined by utilizing the previous central position and the map presentation operation, and then the current view range is determined by the current central position and the current loading range, so that the data to be loaded can be obtained according to the current view range, the data quantity required to be rendered is reduced, and the rendering processing speed is accelerated.
In some embodiments of the present invention, in the first embodiment, map elements are correspondingly drawn on a preset map base map, so as to obtain a current map and display the map, that is, a specific implementation process of S105 in the first embodiment, as shown in fig. 6, may include: s1051 to S1053 are as follows:
s1051, position information corresponding to the map element is acquired.
Because the map element obtained after the pre-rendering has the longitude and latitude coordinates indicating the geographic position, the terminal can acquire the longitude and latitude coordinate information indicating the geographic position of the map element from the map element as the position information, so that the terminal can conveniently determine the pre-loading position on the preset map base map.
In acquiring the position information corresponding to the map element, longitude and latitude coordinate information of all map elements is acquired.
S1052, determining a pre-loading position on the preset map base map according to the position information.
After obtaining the position information corresponding to the map element, the terminal also needs to determine the position for loading the map element, namely the pre-loading position, on the preset map base map, and only after determining the pre-loading position on the preset map base map, the terminal can correspondingly draw the map element.
In the embodiment of the present invention, after obtaining the position information corresponding to all map elements, the terminal can search the longitude and latitude coordinate points corresponding to each position information on the preset map base map, and determine the longitude and latitude coordinate points as the preloaded position.
S1053, drawing the map elements on the preloaded position, obtaining the current map and displaying the current map.
After the preloaded positions are determined, the terminal can draw the map elements on the preloaded positions corresponding to each map element one by one, and after drawing of all the map elements is completed, the terminal obtains a current map and displays the obtained current map on a display interface.
In the embodiment of the invention, when the terminal draws the map, the rendered map elements are directly and correspondingly drawn on the preset map base map, so that when the map is presented, only the map elements are required to be stored in the memory, the consumption of the memory can be reduced, and the influence on the processing speed of the system is reduced.
Example III
Based on the same inventive concept as the first embodiment, referring to fig. 7, after the map elements are correspondingly drawn on the preset map base map, the current map is obtained and displayed, that is, after S105, the method may further include: s106 to S109, as follows:
S106, acquiring a current view level, and determining a preloading offset of the current view range according to a preset relationship between the view level and the loading offset.
After the terminal obtains the current map and displays the current map, the terminal can also obtain the current view level corresponding to the current view range, and determine the preloading offset of the current view range according to the preset relationship between the view level and the loading offset, so that the terminal can determine a preloading range around the current view range according to the determined preloading offset, and preload map data in the range.
It should be noted that, since the current view range is determined by the current loading range and the current center position, and the current loading range is determined according to the current view level, after determining the current view level, the terminal is necessarily able to acquire the current view level corresponding to the current view range.
Alternatively, the preset relationship between the view level and the preload offset in the embodiment of the present invention may be set according to actual requirements, which is not limited herein.
It should be noted that, the preloaded offset in the embodiment of the present invention is used to indicate the latitude and longitude values that can be loaded from the current view range to the periphery of the current view range. After determining the pre-load offset, the terminal can determine that the pre-load view is within the range according to the pre-load offset and the current view range.
And S107, determining a preloaded view range according to the current view range and the preloaded offset.
The terminal determines a preloaded view range, namely, extends a preloaded offset to the periphery of the current view range on the basis of the current view range, namely, the longitude and latitude range of the current map, so as to obtain a longitude and latitude range which encloses the current view range.
Illustratively, when the current view range is (xmin, ymin, xmax, ymax) and the preloaded offset is key, the terminal can obtain a latitude and longitude range (xmin-key, ymin-key, xmax+key, ymax+key) surrounding the current view range, and the preloaded view range refers to an annular region starting from (xmin, ymin, xmax, ymax) and ending at (xmin-key, ymin-key, xmax+key, ymax+key).
S108, acquiring a preloading base map corresponding to the preloading view range according to the preloading view range, and acquiring preloading data corresponding to the preloading view range from a map database.
After the preloaded view range is determined, the terminal can acquire a preloaded base map corresponding to the preloaded view range, acquire map data corresponding to the preloaded view range from a map database according to longitude and latitude information corresponding to the preloaded view range, and take the acquired map data as preloaded data.
And S109, pre-rendering the pre-loaded data to obtain a pre-loaded element, and correspondingly drawing the pre-loaded element on the pre-loaded base map.
After the pre-loading data are obtained, the terminal pre-renders the pre-loading data to obtain pre-loading elements, longitude and latitude coordinates indicating the geographic position are obtained from all the pre-loading elements after the pre-loading data are obtained, so that position information corresponding to all the pre-loading elements is obtained, then the corresponding longitude and latitude coordinates are searched on a pre-loading base map according to the position information of the pre-loading elements, and the pre-loading elements are correspondingly drawn on the pre-loading map base map to finish pre-loading of the map.
After the preloading elements are mapped on the preloading base map, the preloading process is completed, and the mapped preloading map is not displayed. In this way, the terminal can preload the map around the current view range, and when the map presenting operation is received again, that is, the current view range is changed, the part of the preloaded map which is already processed can be directly displayed.
In the embodiment of the invention, after the terminal finishes the drawing and displaying of the current map, the terminal can also preload the map in the preloaded view range, so that when the terminal receives the map presenting operation again and the view range of the map changes, the preloaded map can be directly presented, only map data except the preloaded data need to be processed, the data amount needing to be processed is reduced, the processing time is further shortened, and the instantaneity is improved.
In some embodiments of the present invention, determining the data to be loaded according to the current view range in the first embodiment, that is, the specific implementation process of S103 in the first embodiment, referring to fig. 8, may include: s1031 or S1032, as follows:
s1031, according to the current view range, map data corresponding to the current view range is obtained from a map database and used as data to be loaded.
The terminal can directly send a data request to the map database according to the current view range, namely the longitude and latitude range of the map to be presented, so as to acquire the map data corresponding to the current view range, and directly determine the data as the data to be loaded. At this time, it is indicated that when the terminal determines the data to be loaded, redundancy removal processing is not performed on the obtained map data, and all the obtained map data are directly used as the data to be loaded according to the current view range, so that the obtained data to be loaded is pre-rendered subsequently.
S1032, determining the data to be loaded according to the current view range and the previous view range.
The current view range is changed based on the previous view range no matter the map presenting operation is the drag operation or the zoom operation, so that the current map is very likely to contain the content of the previous map, the repeated map data is unnecessary to be rendered and drawn again, and the terminal only needs to render and draw the newly added map data. At this time, the terminal needs to determine the newly added map data according to the current view range and the previous view range, and uses the newly added map data as the data to be loaded.
Specifically, referring to fig. 9, the determination of the data to be loaded according to the current view range and the previous view range may be determined according to S1032a-S1032c, as follows:
s1032a, map data corresponding to the previous view range, the previous view level corresponding to the previous view range, and the current view level corresponding to the current view range are acquired.
Before determining the data to be loaded according to the current view range and the previous view range, the terminal needs to acquire map data corresponding to the previous view range, a previous view level corresponding to the previous view range and a current view level corresponding to the current view range, only after acquiring the content, the terminal judges the size relation between the previous view level and the current view level, and then the terminal determines the data to be loaded according to the judging result.
After each map is drawn, the terminal caches the map data corresponding to the view range of the map in the memory, so that the terminal can acquire the map data corresponding to the previous view range in the memory.
S1032b, when the current view level is smaller than the previous view level, determining the map data corresponding to the previous view range as the data to be loaded.
When the terminal judges that the current view level is smaller than the previous view level, the terminal indicates that the user reduces the scale level through the scaling operation, so that the map is displayed in a shorthand way. When the map is displayed in a simplified manner, only a part of the original map data is displayed, and no new data is added, so that at the moment, the terminal does not need to acquire the map data from the map database, and only needs to directly determine the map data corresponding to the previous view range as the data to be loaded.
For example, the current view level is denoted as n, the previous view level is denoted as m, the map data corresponding to the previous view range is denoted as a data set a, and when the terminal determines that n < m, the terminal does not send a data request to the map database any more, and the data set a is directly used as data to be loaded.
S1032c, when the current view level is not smaller than the previous view level, acquiring map data corresponding to the current view range from a map database according to the current view range; and determining the data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range.
When the terminal judges that the current view level is not smaller than the previous view level, the user is shown to enlarge the scale level through the zoom operation, so that the map is displayed more finely, or the scale level is not changed, and the view range of the map is moved through the drag operation, wherein the two cases can relate to newly added data. At this time, the terminal needs to send a data request to the map database, acquire map data corresponding to the current view range from the map database, and then determine data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range.
Further, in the embodiment of the present invention, according to the map data corresponding to the current view range and the map data corresponding to the previous view range, the data to be loaded is determined, as shown in fig. 10, including: s201 to S202 are as follows:
s201, intersecting map data corresponding to a previous view range with map data corresponding to a current view range to obtain intersecting map data.
The terminal obtains intersection map data by intersecting map data corresponding to a previous view range obtained from a memory with map data corresponding to a current view range obtained from a database, and performs subsequent data to be loaded determining operation according to the intersection map data.
It should be noted that, the intersection map data is used to represent, in the map data corresponding to the current view range, the already existing data portion that is the same as the map data corresponding to the previous view range, that is, the duplicate data, which is already rendered and drawn, and no further processing is required.
S202, removing intersection map data from map data corresponding to the current view range, and taking the rest map data as data to be loaded.
After acquiring the intersection map data, the terminal removes the intersection map data from the map data corresponding to the current view range, at this time, the remaining map data is newly added map data in the map data corresponding to the current view range, and the terminal only needs to render and draw the newly added data, namely lazy loading is performed, so that the data volume required to be rendered is reduced, and the rendering processing time is further reduced.
For example, when the map data corresponding to the current view range is recorded as a data set B, the intersection map data may be denoted as a n B, and at this time, the data to be loaded to be rendered is B- (a n B).
As shown in fig. 11, an exemplary process schematic of a map presenting method is provided in the embodiment of the present invention, a map presenting operation is received on a display interface of a previous map, a current view range (xmin, ymin, xmax) is determined according to a previous view range corresponding to the previous map and the map presenting operation, a terminal obtains map data corresponding to a current view level, a previous view level and the previous view range, when it is determined that the current view level is not smaller than the previous view level, the terminal requests map data from a map database according to the current view range, sets map data corresponding to the requested current view range as a data set B, determines a pre-load offset key according to the current view range during pre-loading, and further determines pre-load ranges (xmin, ymin, xmax) to (xmin-key, xmax+key, ymax+key), and pre-loads (xmin, ymax) to (xmin-x+key, xmin+key), and only pre-loads data in real time, except map+ymax. When lazy loading is performed, the data set B is subjected to decrement data processing according to the map data corresponding to the previous map view range, so that the data volume required to be rendered is reduced, the processing time is shortened, and the instantaneity is improved.
In the embodiment of the invention, when the current view level is smaller than the previous view level, the terminal directly uses the map data corresponding to the previous view range as the data to be loaded, and at the moment, the terminal does not need to acquire new data from a map database, only needs to directly draw the processed map elements, and reduces the processing time required by rendering; when the current view level is not smaller than the previous view level, the map data corresponding to the current view range is removed from the map data corresponding to the previous view range, so that new map data is obtained, the data quantity required to be rendered is further reduced, and when the data quantity required to be rendered is reduced, map elements obtained through rendering are also reduced, and when the map is drawn, only a small amount of map elements are required to be stored in a memory, so that the consumption of the memory is reduced, the influence on the processing speed of the system is reduced, and the instantaneity of map presentation is further improved.
Example IV
Based on the same inventive concept as the first embodiment, referring to fig. 1, when the display interface of the previous map is the display interface of the initialization map, the first embodiment may further include, before receiving the map presenting operation, that is, before S101, on the display interface of the previous map: S110-S112, as follows:
S110, acquiring a preset initialization map base map and a preset initialization view range, and acquiring initialization loading data from a map database according to the preset initialization view range.
When the display interface of the previous map is the display interface of the initialization map, the terminal needs to determine the initialization map before receiving the map presentation operation on the display interface of the previous map. Specifically, the terminal may acquire a preset initialization map base map and an initialization view range from itself, then send a data request to the map database, and acquire initialization loading data from the map database according to the preset initialization view range.
In the embodiment of the invention, when the terminal does not receive any map presenting operation, the terminal is started for the first time, and at this time, the display interface of the terminal, which is used for receiving the map before the map presenting operation for the first time, is the display interface of the initialized map, which is displayed on the display interface of the terminal.
The initialization view range acquired by the terminal refers to the latitude and longitude range of the map to be drawn, which is stored in the terminal in advance. Correspondingly, the preset initialization map base map acquired by the terminal is a map base map which is prestored in the terminal and corresponds to the preset initialization view range, and more specifically, the preset initialization map base map is a map base map with the same longitude and latitude range as the preset initialization range.
It should be noted that, since the map data are the stored space coordinate data and attribute data in an object-oriented manner, the initialization loading data obtained by the terminal also has the space coordinate data indicating the geographic position and the attribute data corresponding to the space coordinate data.
S111, pre-rendering the initialization loading data to obtain an initialization element.
After the terminal acquires the initialization data to be loaded from the map database, the terminal pre-renders the initialization loading data to obtain an initialization element. Since the initialization data to be loaded has the space coordinate data indicating the geographic position, the initialization elements obtained through pre-rendering also have the space coordinate data indicating the position, so that the initialization elements can be drawn on the initialization preset map base map later.
And S112, correspondingly drawing the initialization elements on a preset initialization map base map to obtain an initialization map and displaying the initialization map.
After obtaining the initialization element, the terminal can find a corresponding loading position on a preset initialization map base map according to the position information in the initialization element, then the terminal draws the initialization element on the corresponding loading position to complete drawing of the initialization map, and the drawn initialization map is displayed on a display interface of the terminal.
In the embodiment of the invention, the terminal can determine the initialization loading data according to the pre-stored preset initialization view range, pre-render the obtained initialization loading data to obtain the initialization element, and finally correspondingly draw the initialization element on the preset initialization map base map to obtain the initialization map and display the initialization map, so that the terminal can receive the map presentation operation on the display interface of the initialization map, thereby facilitating the subsequent map presentation processing.
Example five
Based on the same inventive concept as the first to fourth embodiments, as shown in fig. 13, an embodiment of the present invention provides a terminal 1, which is applied to a map engine, the terminal 1 may include:
a receiving module 10, configured to receive a map presenting operation on a display interface of a previous map;
an obtaining module 11, configured to obtain a previous view range corresponding to a previous map;
a determining module 12, configured to determine a current view range and a preset map base map corresponding to the current view range according to the previous view range and the map presenting operation; determining data to be loaded according to the current view range;
The processing module 13 is used for pre-rendering the data to be loaded to obtain map elements; drawing the map elements on a limited preset map base map to obtain a current map;
a display module 14 for displaying the current map.
In some embodiments of the present invention, the obtaining module 11 is specifically configured to obtain, based on the previous view range, a previous view level and a previous center position corresponding to the previous view range; and acquiring the preset map base map corresponding to the current view range.
The determining module 12 is specifically configured to determine a current view level by using the map presenting operation and the previous view level, and determine a current loading range corresponding to the current view level according to a corresponding relationship between a preset view level and a loading range; determining a current center position according to the map presentation operation and the previous center position; and determining the current view range by utilizing the current center position and the current loading range.
In some embodiments of the present invention, the obtaining module 11 is specifically configured to obtain a zoom level of the map presenting operation when the map presenting operation is a zoom operation;
The determining module 12 is specifically configured to determine the current view level by using the previous view level and the zoom level, and obtain a current loading range corresponding to the current view level according to a corresponding relationship between a preset view level and a loading range; and when the map presenting operation is a dragging operation, determining the previous view level as the current view level, and obtaining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range.
In some embodiments of the present invention, the determining module 12 is specifically configured to determine the previous center position as the current center position when the map presenting operation is a zoom operation; determining the current center position according to the previous center position and the moving distance;
the obtaining module 11 is specifically configured to obtain, when the map presenting operation is a drag operation, a moving distance of the map presenting operation.
In some embodiments of the present invention, the obtaining module 11 is specifically configured to obtain location information corresponding to the map element;
The determining module 12 is specifically configured to determine a pre-loading position on the preset map base map according to the position information;
the processing module 13 is specifically configured to draw the map element at the pre-loading position, so as to obtain the current map;
the display module 14 is specifically configured to display the current map.
In some embodiments of the present invention, the obtaining module 11 is further configured to obtain a current view level; according to the preloaded view range, a preloaded base map corresponding to the preloaded view range is obtained, and preloaded data corresponding to the preloaded view range is obtained from the map database;
the determining module 12 is further configured to determine a preloaded view range according to the current view range and the preloaded offset;
the processing module 13 is further configured to pre-render the pre-loaded data to obtain a pre-loaded element, and correspondingly draw the pre-loaded element on the pre-loaded base map.
In some embodiments of the present invention, the obtaining module 11 is specifically configured to obtain, from a map database, map data corresponding to the current view range as the data to be loaded according to the current view range; or alternatively, the process may be performed,
The determining module 12 is specifically configured to determine the data to be loaded according to the current view range and the previous view range.
In some embodiments of the present invention, the obtaining module 11 is specifically configured to obtain map data corresponding to the previous view range, a previous view level corresponding to the previous view range, and a current view level corresponding to the current view range; when the current view level is not smaller than the previous view level, acquiring map data corresponding to the current view range from the map database according to the current view range
The determining module 12 is specifically configured to determine map data corresponding to the previous view range as the data to be loaded when the current view level is smaller than the previous view level; and determining the data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range.
In some embodiments of the present invention, the determining module 12 is specifically configured to intersect the map data corresponding to the previous view range with the map data corresponding to the current view range to obtain intersection map data; and removing the intersection map data from the map data corresponding to the current view range, and taking the rest map data as the data to be loaded.
In some embodiments of the present invention, the obtaining module 11 is further configured to obtain a preset initialization map base map and a preset initialization view range, and obtain initialization loading data from a map database according to the preset initialization view range;
the processing module 13 is further configured to pre-render the initialization loading data to obtain an initialization element; correspondingly drawing the initialization elements on the preset initialization map base map to obtain an initialization map;
the display module 14 is further configured to display the initialization map.
Example six
Based on the same inventive concept of the first to fourth embodiments, fig. 14 is a schematic diagram of a composition structure of a terminal according to an embodiment of the present invention, and as shown in fig. 14, a terminal according to the present invention may include a processor 01 and a memory 02 storing executable instructions of the processor 01. The processor 01 is configured to execute executable map presentation instructions stored in the memory to implement the method according to any one or more of the first to fourth embodiments.
In an embodiment of the present invention, the processor 01 may be at least one of an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (ProgRAMmable Logic Device, PLD), a field programmable gate array (Field ProgRAMmable Gate Array, FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronics for implementing the above-described processor functions may be other for different devices, and embodiments of the present invention are not particularly limited. The terminal further comprises a memory 02, which memory 02 may be connected to the processor 01, wherein the memory 02 may comprise a high-speed RAM memory, and may further comprise a non-volatile memory, e.g. at least two disk memories.
In practical applications, the Memory 02 may be a volatile Memory (RAM), such as a Random-Access Memory (RAM); or a nonvolatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (HDD) or a Solid State Drive (SSD); or a combination of the above types of memories and provides instructions and data to the processor 01.
In addition, each functional module in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units, if implemented in the form of software functional modules, may be stored in a computer-readable storage medium, if not sold or used as separate products, and based on this understanding, the technical solution of the present embodiment may be embodied essentially or partly in the form of a software product, or all or part of the technical solution may be embodied in a storage medium, which includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or processor (processor) to perform all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
An embodiment of the present invention provides a computer-readable storage medium having stored thereon a implementable program for use in a terminal, the program, when executed by a processor, implementing a method as in any one or more of embodiments one to four.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of implementations of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block and/or flow of the flowchart illustrations and/or block diagrams, and combinations of blocks and/or flow diagrams in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart block or blocks and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart block or blocks and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks and/or block diagram block or blocks.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention.

Claims (11)

1. A map rendering method, applied to a map engine, the method comprising:
receiving a map presentation operation on a display interface of a previous map;
acquiring a previous view range corresponding to a previous map, acquiring a previous view level based on the previous view range, and acquiring a previous center position corresponding to the previous view range; the previous view level is the level of a scale of a previous map when being displayed, and the previous center position is the longitude and latitude coordinate positioned at the center of the previous view range;
determining a current view level by using the map presentation operation and the previous view level, and determining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range;
determining a current center position according to the map presenting operation and the previous center position;
determining a current view range by utilizing the current center position and the current loading range, and acquiring a preset map base map corresponding to the current view range; the preset map base map is a map layer for displaying basic geographic information;
Determining data to be loaded according to the current view range;
pre-rendering the data to be loaded to obtain map elements;
correspondingly drawing the map elements on the preset map base map to obtain a current map and displaying the current map;
acquiring a current view level corresponding to the current view range, and determining a preloading offset of the current view range according to a preset relationship between the view level and the loading offset;
determining a preloading view range according to the current view range and the preloading offset;
according to the preloaded view range, a preloaded base map corresponding to the preloaded view range is obtained, map data corresponding to the preloaded view range is obtained from a map database, and the map data is used as preloaded data;
and pre-rendering the pre-loading data to obtain a pre-loading element, and correspondingly drawing the pre-loading element on the pre-loading base map.
2. The method according to claim 1, wherein determining a current view level using the map presenting operation and the previous view level, and determining a current loading range corresponding to the current view level according to a correspondence between a preset view level and a loading range, includes:
When the map presenting operation is a zooming operation, acquiring a zooming level of the map presenting operation; determining the current view level by using the previous view level and the zoom level, and obtaining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range;
and when the map presenting operation is a dragging operation, determining the previous view level as the current view level, and obtaining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and a loading range.
3. The method of claim 1, wherein said determining a current center position based on said map rendering operation and said previous center position comprises:
when the map presenting operation is a zooming operation, determining the previous center position as the current center position;
when the map presenting operation is a drag operation, acquiring a moving distance of the map presenting operation; and determining the current center position according to the previous center position and the moving distance.
4. The method according to claim 1, wherein the drawing the map element on the preset map base map to obtain and display a current map includes:
acquiring position information corresponding to the map elements;
determining a preloading position on the preset map base map according to the position information;
and drawing the map element on the preloaded position, obtaining the current map and displaying the current map.
5. The method according to claim 1, wherein determining the data to be loaded according to the current view range comprises:
according to the current view range, map data corresponding to the current view range is obtained from a map database and used as the data to be loaded; or alternatively, the process may be performed,
and determining the data to be loaded according to the current view range and the previous view range.
6. The method of claim 5, wherein determining the data to be loaded based on the current view range and the previous view range comprises:
acquiring map data corresponding to the previous view range, a previous view level corresponding to the previous view range, and a current view level corresponding to the current view range;
When the current view level is smaller than the previous view level, determining map data corresponding to the previous view range as the data to be loaded;
when the current view level is not smaller than the previous view level, acquiring map data corresponding to the current view range from the map database according to the current view range; and determining the data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range.
7. The method according to claim 6, wherein the determining the data to be loaded according to the map data corresponding to the current view range and the map data corresponding to the previous view range includes:
intersection of the map data corresponding to the previous view range and the map data corresponding to the current view range is obtained, and intersection map data is obtained;
and removing the intersection map data from the map data corresponding to the current view range, and taking the rest map data as the data to be loaded.
8. The method of claim 1, wherein when the display of the previous map is the display of an initialization map, the method further comprises, prior to receiving a map rendering operation on the display of the previous map:
Acquiring a preset initialization map base map and a preset initialization view range, and acquiring initialization loading data from a map database according to the preset initialization view range;
pre-rendering the initialization loading data to obtain an initialization element;
and correspondingly drawing the initialization elements on the preset initialization map base map to obtain and display an initialization map.
9. A terminal, the terminal comprising:
the receiving module is used for receiving map presentation operation on a display interface of a previous map;
the acquisition module is used for acquiring a previous view range corresponding to a previous map;
the determining module is used for acquiring a previous view level and a previous center position corresponding to the previous view range based on the previous view range; the previous view level is the level of a scale of a previous map when being displayed, and the previous center position is the longitude and latitude coordinate positioned at the center of the previous view range; determining a current view level by using the map presentation operation and the previous view level, and determining a current loading range corresponding to the current view level according to a corresponding relation between a preset view level and the loading range; determining a current center position according to the map presenting operation and the previous center position; determining a current view range by utilizing the current center position and the current loading range, and acquiring a preset map base map corresponding to the current view range; the preset map base map is a map layer for displaying basic geographic information;
The determining module is further configured to determine data to be loaded according to the current view range;
the processing module is used for prerendering the data to be loaded to obtain map elements; drawing the map elements on a limited preset map base map to obtain a current map;
the display module is used for displaying the current map;
the acquisition module is further configured to acquire a current view level corresponding to the current view range;
the determining module is further configured to determine a pre-load offset of the current view range according to a preset relationship between a view level and a load offset; determining a preloading view range according to the current view range and the preloading offset;
the acquisition module is further used for acquiring a pre-load base map corresponding to the pre-load view range according to the pre-load view range, acquiring map data corresponding to the pre-load view range from a map database, and taking the map data as pre-load data;
the processing module is further configured to pre-render the pre-loaded data to obtain a pre-loaded element, and correspondingly draw the pre-loaded element on the pre-loaded base map.
10. A terminal, the terminal comprising: a memory and a processor;
the memory is used for storing executable map presentation instructions;
the processor is configured to execute executable map presentation instructions stored in the memory, and implement the method of claims 1-8.
11. A computer readable storage medium, characterized in that executable map rendering instructions are stored for causing a processor to implement the method of any one of claims 1-8 when executed.
CN201910754851.8A 2019-08-15 2019-08-15 Map presentation method, terminal and computer readable storage medium Active CN112395375B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910754851.8A CN112395375B (en) 2019-08-15 2019-08-15 Map presentation method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910754851.8A CN112395375B (en) 2019-08-15 2019-08-15 Map presentation method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112395375A CN112395375A (en) 2021-02-23
CN112395375B true CN112395375B (en) 2023-08-01

Family

ID=74601680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910754851.8A Active CN112395375B (en) 2019-08-15 2019-08-15 Map presentation method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112395375B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114661755A (en) * 2022-03-29 2022-06-24 北京百度网讯科技有限公司 Display mode, device and electronic equipment
CN114969192B (en) * 2022-05-12 2023-03-17 北京骏德时空科技有限公司 Map tour method, device, equipment and medium based on data management

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104504106A (en) * 2014-12-04 2015-04-08 中移全通系统集成有限公司 Map covering region rendering method and related equipment
CN108446066A (en) * 2018-03-14 2018-08-24 杭州骑迹科技有限公司 A kind of loading method and mobile terminal of map label

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104504106A (en) * 2014-12-04 2015-04-08 中移全通系统集成有限公司 Map covering region rendering method and related equipment
CN108446066A (en) * 2018-03-14 2018-08-24 杭州骑迹科技有限公司 A kind of loading method and mobile terminal of map label

Also Published As

Publication number Publication date
CN112395375A (en) 2021-02-23

Similar Documents

Publication Publication Date Title
US11585675B2 (en) Map data processing method, computer device and storage medium
US9417777B2 (en) Enabling quick display transitions between indoor and outdoor map data
US9110573B2 (en) Personalized viewports for interactive digital maps
US8928657B2 (en) Progressive disclosure of indoor maps
CN110990516B (en) Map data processing method, device and server
CN109977192B (en) Unmanned aerial vehicle tile map rapid loading method, system, equipment and storage medium
US9652115B2 (en) Vertical floor expansion on an interactive digital map
US9448754B2 (en) Resolving label collisions on a digital map
US8970583B1 (en) Image space stylization of level of detail artifacts in a real-time rendering engine
EP2954468B1 (en) Providing indoor facility information on a digital map
CN112233240B (en) Three-dimensional vector data slicing method and device of three-dimensional vector map and electronic equipment
US8749580B1 (en) System and method of texturing a 3D model from video
US9684947B2 (en) Indicating availability of indoor content on a digital map
CN112395375B (en) Map presentation method, terminal and computer readable storage medium
CN113711166B (en) Semantic augmented artificial reality experience
CN111414104B (en) Electronic map local display method and device
JP7086180B2 (en) Dynamic styling of digital maps
CN111966853B (en) Management method of remote sensing image
US20140317516A1 (en) Address formatting on a digital map
US20150154784A1 (en) Use of Photo Animation Transitions to Mask Latency
CN107977923A (en) Image processing method, device, electronic equipment and computer-readable recording medium
CN108573513B (en) Random element generation method and random element generation device
NL2033044B1 (en) File Archive for Geographic Raster Data
CN117112950B (en) Rendering method, device, terminal and storage medium for objects in electronic map
CN111506681A (en) Intersection generating method and device, rendering method, medium, terminal and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant