CN113821737A - Map rendering method, device and equipment for single-page application and storage medium - Google Patents

Map rendering method, device and equipment for single-page application and storage medium Download PDF

Info

Publication number
CN113821737A
CN113821737A CN202111155213.8A CN202111155213A CN113821737A CN 113821737 A CN113821737 A CN 113821737A CN 202111155213 A CN202111155213 A CN 202111155213A CN 113821737 A CN113821737 A CN 113821737A
Authority
CN
China
Prior art keywords
task
rendering
map
page application
download
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.)
Granted
Application number
CN202111155213.8A
Other languages
Chinese (zh)
Other versions
CN113821737B (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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202111155213.8A priority Critical patent/CN113821737B/en
Publication of CN113821737A publication Critical patent/CN113821737A/en
Application granted granted Critical
Publication of CN113821737B publication Critical patent/CN113821737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
    • 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)
  • Stored Programmes (AREA)

Abstract

The application relates to artificial intelligence, and provides a map rendering method, a map rendering device, map rendering equipment and a storage medium for single-page application, wherein the method is used for determining whether a calling interface corresponding to the map application exists in a storage area corresponding to the single-page application; if not, determining whether a first download task corresponding to the single-page application exists in a preset download task list; and if so, waiting for the execution of the first downloading task until the first downloading task is completed, and calling the downloaded calling interface to process the rendering tasks in the single-page application. According to the method and the device, the mode that the plurality of rendering tasks are processed by downloading one calling interface is used for replacing the mode that the plurality of calling interfaces are downloaded to process the plurality of rendering tasks, the problem that map rendering fails due to the fact that a downloading request of the calling interface is interrupted is avoided, the map rendering effect of single-page application is improved, and user experience is improved.

Description

Map rendering method, device and equipment for single-page application and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a map rendering method, apparatus, device, and computer-readable storage medium for single-page applications.
Background
A Single Page Application (SPA) refers to a Single Page webApplication, i.e., an application with only one web Page, which is a web application that loads a Single html (HyperText Markup Language) Page and dynamically updates the Page when a user interacts with the application. Wherein, the single page jump only refreshes local resources, and common resources (such as js, css and the like) in the single page application only need to be loaded once.
Currently, when a single-page application calls a map application (such as a high-resolution map or a Baidu map) to render a plurality of maps in a page, a call interface of the map application is downloaded (i.e., loaded) for each rendering task, and the map application is called through the downloaded call interfaces to process the corresponding rendering tasks. Therefore, when a calling interface is downloaded in a current rendering task, a downloading request of the calling interface of another rendering task is easily interrupted, so that partial map rendering fails, for example, when a user applies for a car insurance claim in a single-page application and a plurality of maps such as the position of a surveyor and the navigation track of a trailer are rendered by calling related software, only the position of the surveyor can be rendered, but the navigation track of the trailer cannot be rendered. Therefore, how to solve the problem that when the existing single-page application calls the map application to render a plurality of maps, partial map rendering failure exists, so that the map rendering effect of the single-page application is poor becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The invention mainly aims to provide a map rendering method, a map rendering device, map rendering equipment and a computer readable storage medium for single-page application, and aims to solve the technical problem that the map rendering effect of the existing single-page application is poor.
In order to achieve the above object, the present invention provides a map rendering method for a single-page application, including the steps of: when a map calling instruction sent by a single-page application is received, determining whether a calling interface corresponding to the map application exists in a storage area corresponding to the single-page application; if the calling interface does not exist in the storage area, determining whether a first download task corresponding to the single-page application exists in a preset download task list; and if the first download task exists in the download task list, waiting for the execution of the first download task until the first download task is completed, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application.
In addition, to achieve the above object, the present invention also provides a map rendering apparatus for a single-page application, including: the system comprises a calling interface determining module, a map application processing module and a map processing module, wherein the calling interface determining module is used for determining whether a calling interface corresponding to the map application exists in a storage area corresponding to a single-page application when a map calling instruction sent by the single-page application is received; the download task confirming module is used for determining whether a first download task corresponding to the single-page application exists in a preset download task list if the calling interface does not exist in the storage area; and the first task processing module is used for waiting for the execution of the first download task if the first download task exists in the download task list, and calling the downloaded calling interface to process the rendering tasks in the single-page application until the first download task is completed.
In addition, to achieve the above object, the present invention further provides a map rendering device of a single-page application, which includes a processor, a memory, and a map rendering program of the single-page application stored on the memory and executable by the processor, wherein when the map rendering program of the single-page application is executed by the processor, the steps of the map rendering method of the single-page application are implemented.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having a map rendering program of a single-page application stored thereon, wherein when the map rendering program of the single-page application is executed by a processor, the steps of the map rendering method of the single-page application are implemented.
The invention provides a map rendering method of a single-page application, which determines whether a calling interface corresponding to the map application exists in a storage area corresponding to the single-page application when a map calling instruction sent by the single-page application is received; if the calling interface does not exist in the storage area, determining whether a first download task corresponding to the single-page application exists in a preset download task list; and if the first download task exists in the download task list, waiting for the execution of the first download task until the first download task is completed, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application. By the mode, the downloading request of the calling interface is sent only once aiming at the multiple rendering tasks in the single-page application, the mode of processing the multiple rendering tasks by downloading one calling interface is replaced by the mode of processing the multiple rendering tasks by downloading the multiple calling interfaces, the problem that partial map rendering fails in the single-page application due to the fact that the downloading request of the calling interface of one rendering task is interrupted is avoided, the map rendering effect of the single-page application is improved, user experience is improved, and the technical problem that the map rendering effect of the existing single-page application is poor is solved.
Drawings
Fig. 1 is a schematic hardware configuration diagram of a map rendering device for a single-page application according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a map rendering method for single-page applications according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a map rendering method for single-page applications according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a map rendering method for single-page applications according to a third embodiment of the present invention;
FIG. 5 is a functional block diagram of a map rendering apparatus for single-page applications according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The map rendering method of the single-page application related to the embodiment of the invention is mainly applied to the map rendering equipment of the single-page application, and the map rendering equipment of the single-page application can be equipment with display and processing functions, such as a PC (personal computer), a portable computer, a mobile terminal and the like.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of a map rendering device for a single-page application according to an embodiment of the present invention. In an embodiment of the present invention, a map rendering apparatus for a single-page application may include a processor 1001 (e.g., a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used for realizing connection communication among the components; the user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface); the memory 1005 may be a high-speed RAM memory, or may be a non-volatile memory (e.g., a magnetic disk memory), and optionally, the memory 1005 may be a storage device independent of the processor 1001.
Those skilled in the art will appreciate that the hardware configuration shown in fig. 1 does not constitute a limitation of the map rendering device for single page applications, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
With continued reference to fig. 1, the memory 1005 of fig. 1, which is one type of computer-readable storage medium, may include an operating system, a network communication module, and a map rendering program for a single-page application.
In fig. 1, the network communication module is mainly used for connecting to a server and performing data communication with the server; and the processor 1001 may call a map rendering program of the single-page application stored in the memory 1005 and perform the map rendering method of the single-page application provided by the embodiment of the present invention.
The embodiment of the invention provides a map rendering method for single-page application.
Referring to fig. 2, fig. 2 is a flowchart illustrating a map rendering method for a single-page application according to a first embodiment of the present invention.
In this embodiment, the map rendering method for single-page application is applied to a processor or a program for monitoring map calling of each page application, and the map rendering method for single-page application includes the following steps:
step S10, when receiving a map calling instruction sent by a single page application, determining whether a calling interface corresponding to the map application exists in a storage area corresponding to the single page application;
when a plurality of maps are rendered by the current single-page application, the calling interface of the map application is downloaded (loaded) for each rendering task, and when the downloading of the downloaded calling interface is successful, the map application is called by the downloaded calling interface to process the rendering task. However, when the previous rendering task downloads the call interface, the previous rendering task is easily interrupted by the request of downloading the call interface by the next rendering task, so that the previous rendering task cannot monitor the success of downloading the call interface, and the rendering of the previous rendering task fails, thereby causing the rendering failure of the map corresponding to the rendering task.
According to the method and the device, the mode that one calling interface is downloaded to process a plurality of rendering tasks is used for replacing the mode that the existing calling interfaces process a plurality of rendering tasks, and the problem that the single-page application map rendering effect is poor due to the fact that the downloading request of the calling interface of one rendering task is interrupted is solved.
In this embodiment, when a map call instruction of a map application sent by a single-page application is detected, it is first detected whether a downloaded call interface of the map application exists in a storage area (for example, a file storing data corresponding to the target page application) corresponding to the single-page application, and if the downloaded call interface exists, the downloaded call interface is directly called to sequentially process a plurality of rendering tasks without repeatedly downloading the call interface.
For example, the determining whether a call interface corresponding to the map application exists in the storage area corresponding to the single-page application specifically includes:
and determining whether an interface identifier of the calling interface or a variable identifier of a global variable for storing the calling interface exists in the storage area.
In this embodiment, when the downloading of the calling interface is completed, a global variable AMap is defined in the storage area of the single-page application, and is used for storing the calling interface of the map application. Therefore, when determining whether the downloaded call interface exists in the storage area, the interface identifier of the call interface may be searched in the storage area, and the variable identifier of the global variable may also be searched in the storage area, and if the interface identifier of the call interface exists in the storage area or the variable identifier of the global variable for storing the call interface exists in the storage area, it may indicate that the downloaded call interface exists in the storage area. If the interface identifier of the calling interface does not exist in the storage area, the variable identifier of the global variable for storing the calling interface does not exist, that is, the downloaded calling interface does not exist in the storage area.
Step S20, if the calling interface does not exist in the storage area, determining whether a first download task corresponding to the single-page application exists in a preset download task list based on a download task identifier;
in this embodiment, before downloading the map call interface, a script element needs to be newly created for each download task, and a corresponding Identifier (ID) is set for the script element corresponding to each download task. Through the method, the corresponding downloading task identifier (script element ID) is set for the downloading task corresponding to each page application, and the downloading data of the page application is recorded through the downloading task table. The map calling interface is used for receiving a map application, wherein the map calling interface is used for calling a map according to a map application, and the map calling interface is used for calling a map according to a map application; the download task table may also be a record table of download tasks corresponding to each page application, that is, record each call interface downloaded by each page application and a download task identifier corresponding to each download task of each call interface downloaded by each page application.
Specifically, if the downloaded call interface does not exist in the storage area, the identifier of the download task for downloading the call interface based on the single-page application is further searched in the download task list, and if the identifier exists in the download task list, the identifier indicates that the interface download task (the first download task) currently exists in the download.
Step S30, if the first download task exists in the download task list, wait for the execution of the first download task, and call the downloaded call interface to process the rendering tasks in the single-page application until the first download task is completed.
In this embodiment, when the first download task exists in the download task list, the download request of the invocation interface does not need to be repeatedly triggered, execution of the first download task in the download is waited, and when the first download task completes the download of the invocation interface, the invocation interface is invoked to sequentially process the rendering tasks. Therefore, when the single-page application does not have a calling interface for completing downloading, whether an interface downloading task in downloading exists in the single-page application is further judged, and if yes, the execution of the downloading task in downloading is waited until the execution is completed.
Further, the step S30 specifically includes:
if the first downloading task exists in the downloading task list, acquiring downloading time corresponding to the first downloading task;
and when the downloading time does not exceed a preset time threshold, generating and displaying prompt information in the downloading of a map calling interface, waiting for the execution of the first downloading task, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application until the first downloading task is completed.
In this embodiment, if the first download task exists in the download task list, it indicates that the single-page application has sent a download request corresponding to downloading the call interface. That is to say, there are currently ongoing and incomplete download tasks, and in order to avoid the call interface download abnormality caused by the timeout of the download task, the download time of the download task is monitored, and if the download time does not exceed the preset time threshold, it indicates that the first download task is not abnormal, and a prompt message in the map call interface download is generated and displayed, so as to avoid the user from repeatedly triggering the download instruction, improve the user experience, and facilitate the user to know the map rendering progress.
Further, if the first download task exists in the download task list, after obtaining the download time corresponding to the first download task, the method further includes:
when the downloading time exceeds a preset time threshold, interrupting the first downloading task, sending a downloading request through a preset map downloading public component, generating a third downloading task of the calling interface downloaded by the single-page application, and adding a corresponding downloading task identifier to the third downloading task;
and waiting for the execution of the third downloading task until the third downloading task finishes downloading, and calling the downloaded calling interface to process the plurality of rendering tasks in the single-page application.
In this embodiment, when the download time exceeds a preset time threshold, that is, it indicates that the first download task is abnormal, the abnormal download task (the first download task) is interrupted, then a preset map download common component (a component for downloading a call interface of a map application) is called to resend a request for downloading the call interface to a server, that is, a new download task (a third download task) is created, and a corresponding identifier is added to the third download task, so that the third download task is searched based on the download task identifier of the third download task.
Specifically, in order to increase maintainability of the map rendering program, based on the existing logic code (such as the map rendering application program) for calling the map application to perform rendering task processing, the logic code for calling the interface download is extracted, and packaged as a map download common component for sending a download request to perform the calling interface download, so as to serve as a preset map download common component.
For example, the step of processing the plurality of rendering tasks in the single-page application by invoking the downloaded invocation interface specifically includes:
obtaining each map rendering task, and adding each map rendering task to a rendering task queue;
acquiring a rendering task in the rendering task queue as a target rendering task, calling the calling interface, and processing the target rendering task based on rendering data corresponding to the target rendering task;
acquiring a next rendering task in the rendering task queue as the target rendering task, and executing: and calling the calling interface, and processing the target rendering task based on rendering data corresponding to the target rendering task until all rendering tasks in the rendering task queue are completed.
In this embodiment, a plurality of map rendering tasks are added to the rendering task queue, and when it is monitored that the downloading of the calling interface is completed or the downloaded calling interface is detected to exist at present, each rendering task in the rendering task queue is sequentially processed through the calling interface. A global variable array initAmpaArray is predefined and used as the rendering task queue for storing a plurality of rendering tasks.
Specifically, a rendering task in the rendering task queue is obtained as a target rendering task, the call interface is called, and a map of a corresponding area in the single-page application is rendered according to rendering data corresponding to the target rendering task, so that processing of the target rendering task is completed. And then acquiring the next rendering task in the rendering task queue as an updated target rendering task, and calling the calling interface to sequentially complete the processing of each rendering task in the rendering task queue.
In a specific embodiment, when a rendering task is processed, a corresponding rendering completion identifier is added to the completed rendering task, so that the processed rendering task and the unprocessed rendering task can be distinguished conveniently.
The embodiment provides a map rendering method for a single-page application, which determines whether a calling interface corresponding to the map application exists in a storage area corresponding to the single-page application when a map calling instruction sent by the single-page application is received; if the calling interface does not exist in the storage area, determining whether a first download task corresponding to the single-page application exists in a preset download task list; and if the first download task exists in the download task list, waiting for the execution of the first download task until the first download task is completed, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application. In this way, the embodiment only sends the download request of calling the interface once for a plurality of rendering tasks in the single-page application, the mode of processing the plurality of rendering tasks by downloading one calling interface replaces the mode of processing the plurality of rendering tasks by downloading the plurality of calling interfaces, the problem that partial map rendering fails in the single-page application due to interruption of the download request of the calling interface of one rendering task is avoided, the map rendering effect of the single-page application is improved, the user experience is improved, and the technical problem that the map rendering effect of the existing single-page application is poor is solved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a map rendering method for a single-page application according to a second embodiment of the present invention.
Based on the foregoing embodiment shown in fig. 2, in this embodiment, after step S20, the method further includes:
step S40, if the first download task does not exist in the download task list, sending a download request through a preset map download common component, generating a second download task of the single-page application download calling interface, and adding a corresponding download task identifier to the second download task;
step S50, when it is detected that the second download task completes downloading, the downloaded call interface is called to process a plurality of rendering tasks in the single-page application.
In this embodiment, if the first download task does not exist in the download task list, that is, the download task does not exist at present, that is, the call interface for completing the download does not exist, and the download task in the download does not exist, a request for downloading the call interface is sent to the server through the preset map download common component, a download task (a second download task) of the single-page application download call interface is newly created, and a corresponding download task identifier is added to the second download task. Therefore, the calling interface is downloaded to the storage area corresponding to the single-page application through the second downloading task, and then the downloaded calling interface is called to process the rendering tasks.
Therefore, when the single-page application does not have a calling interface for completing downloading, whether an interface downloading task in downloading exists in the single-page application is further judged, if not, an interface downloading task is newly established, and the downloading calling interface carries out processing on a plurality of rendering tasks. Therefore, repeated downloading of the calling interface is avoided, not only is the downloading task prevented from being interrupted, but also resource waste caused by repeated downloading of the calling interface is avoided.
Referring to fig. 4, fig. 4 is a flowchart illustrating a map rendering method for single-page application according to a third embodiment of the present invention.
Based on the foregoing embodiment shown in fig. 3, in this embodiment, after step S10, the method further includes:
step S60, if the calling interface exists in the storage area, the calling interface is called to process multiple rendering tasks in the single-page application, so as to avoid repeated downloading of the calling interface.
In this embodiment, if the calling interface exists in the storage area corresponding to the single-page application, the map application is directly called through the calling interface to sequentially process the rendering tasks, and rendering of the map of each area in the single-page application page is completed, so that repeated downloading of the calling interface is avoided, and resource waste is reduced.
In addition, the embodiment of the invention also provides a map rendering device for the single-page application.
Referring to fig. 5, fig. 5 is a functional module diagram of a map rendering apparatus for single-page application according to a first embodiment of the present invention.
In this embodiment, the map rendering apparatus for single-page application includes:
the system comprises a calling interface determining module 10, a map application processing module and a map processing module, wherein the calling interface determining module is used for determining whether a calling interface corresponding to a map application exists in a storage area corresponding to a single-page application when a map calling instruction sent by the single-page application is received;
a download task confirming module 20, configured to determine whether a first download task corresponding to the single-page application exists in a preset download task list if the call interface does not exist in the storage area;
a first task processing module 30, configured to wait for execution of the first download task if the first download task exists in the download task list, and call the downloaded call interface to process the multiple rendering tasks in the single-page application until the first download task is completed.
Further, the map rendering apparatus of the single-page application further includes:
the download task generation module is used for sending a download request through a preset map download common component if the first download task does not exist in the download task list, generating a second download task of the calling interface downloaded by the single-page application, and adding a corresponding download task identifier to the second download task;
and the second task processing module is used for calling the downloaded calling interface to process the plurality of rendering tasks in the single-page application when detecting that the second downloading task completes downloading.
Further, the map rendering apparatus of the single-page application further includes:
and the third task processing module is used for calling the calling interface to process a plurality of rendering tasks in the single-page application if the calling interface exists in the storage area so as to avoid repeated downloading of the calling interface.
Further, the first task processing module 30 specifically includes:
a download time obtaining unit, configured to obtain, if the first download task exists in the download task list, a download time corresponding to the first download task;
and the first task processing unit is used for generating and displaying prompt information in the downloading of a map calling interface when the downloading time does not exceed a preset time threshold, waiting for the execution of the first downloading task, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application until the first downloading task is completed.
Further, the first task processing module 30 specifically further includes:
the download task generating unit is used for interrupting the first download task when the download time exceeds a preset time threshold, sending a download request through a preset map download public component, generating a third download task for downloading the calling interface by the single-page application, and adding a corresponding download task identifier to the third download task;
and the second task processing unit is used for waiting for the execution of the third downloading task and calling the downloaded calling interface to process the plurality of rendering tasks in the single-page application until the third downloading task finishes downloading.
Further, the first task processing unit 30 specifically further includes:
the rendering task obtaining subunit is used for obtaining each map rendering task and adding each map rendering task to the rendering task queue;
the rendering task processing subunit is configured to obtain a rendering task in the rendering task queue, use the rendering task as a target rendering task, call the call interface, and process the target rendering task based on rendering data corresponding to the target rendering task;
a rendering task update subunit, configured to obtain a next rendering task in the rendering task queue, serve as the target rendering task, and execute: and calling the calling interface, and processing the target rendering task based on rendering data corresponding to the target rendering task until all rendering tasks in the rendering task queue are completed.
Further, the call interface determination module 10 is further configured to:
and determining whether an interface identifier of the calling interface or a variable identifier of a global variable for storing the calling interface exists in the storage area.
Each module in the map rendering device of the single-page application corresponds to each step in the map rendering method embodiment of the single-page application, and the functions and the implementation process thereof are not described in detail herein.
In addition, the embodiment of the invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores a map rendering program of a single-page application, wherein when the map rendering program of the single-page application is executed by a processor, the steps of the map rendering method of the single-page application are implemented as described above.
The method for implementing the map rendering program of the single-page application when executed may refer to various embodiments of the map rendering method of the single-page application of the present invention, and details thereof are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A map rendering method for a single-page application is characterized by comprising the following steps:
when a map calling instruction sent by a single-page application is received, determining whether a calling interface corresponding to the map application exists in a storage area corresponding to the single-page application;
if the calling interface does not exist in the storage area, determining whether a first download task corresponding to the single-page application exists in a preset download task list based on a download task identifier;
and if the first download task exists in the download task list, waiting for the execution of the first download task until the first download task is completed, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application.
2. The method for map rendering of a single-page application according to claim 1, wherein, if the calling interface does not exist in the storage area, after the step of determining whether the first download task corresponding to the single-page application exists in a preset download task list, the method further comprises:
if the first download task does not exist in the download task list, sending a download request through a preset map download public component, generating a second download task of the calling interface downloaded by the single-page application, and adding a corresponding download task identifier to the second download task;
and when the second downloading task is detected to finish downloading, calling the downloaded calling interface to process the plurality of rendering tasks in the single-page application.
3. The map rendering method of a single-page application according to claim 2, wherein after the step of determining whether a calling interface corresponding to the map application exists in a storage area corresponding to the single-page application when the map calling instruction sent by the single-page application is received, the method further comprises:
and if the calling interface exists in the storage area, calling the calling interface to process a plurality of rendering tasks in the single-page application so as to avoid repeated downloading of the calling interface.
4. The map rendering method of a single-page application according to claim 1, wherein, if the first download task exists in the download task list, the step of waiting for the execution of the first download task until the first download task completes downloading, and the step of calling the downloaded calling interface to process the rendering tasks in the single-page application specifically includes:
if the first downloading task exists in the downloading task list, acquiring downloading time corresponding to the first downloading task;
and when the downloading time does not exceed a preset time threshold, generating and displaying prompt information in the downloading of a map calling interface, waiting for the execution of the first downloading task, and calling the downloaded calling interface to process a plurality of rendering tasks in the single-page application until the first downloading task is completed.
5. The map rendering method of a single-page application according to claim 4, wherein, after the step of obtaining the download time corresponding to the first download task if the first download task exists in the download task list, the method further comprises:
when the downloading time exceeds a preset time threshold, interrupting the first downloading task, sending a downloading request through a preset map downloading public component, generating a third downloading task of the calling interface downloaded by the single-page application, and adding a corresponding downloading task identifier to the third downloading task;
and waiting for the execution of the third downloading task until the third downloading task finishes downloading, and calling the downloaded calling interface to process the plurality of rendering tasks in the single-page application.
6. The map rendering method of a single-page application according to claim 1, wherein the step of invoking the downloaded invocation interface to process the plurality of rendering tasks in the single-page application specifically includes:
obtaining each map rendering task, and adding each map rendering task to a rendering task queue;
acquiring a rendering task in the rendering task queue as a target rendering task, calling the calling interface, and processing the target rendering task based on rendering data corresponding to the target rendering task;
acquiring a next rendering task in the rendering task queue as the target rendering task, and executing: and calling the calling interface, and processing the target rendering task based on rendering data corresponding to the target rendering task until all rendering tasks in the rendering task queue are completed.
7. The map rendering method of a single-page application according to any one of claims 1 to 6, wherein the step of determining whether a call interface corresponding to the map application exists in the storage area corresponding to the single-page application specifically includes:
and determining whether an interface identifier of the calling interface or a variable identifier of a global variable for storing the calling interface exists in the storage area.
8. A map rendering apparatus of a single-page application, comprising:
the system comprises a calling interface determining module, a map application processing module and a map processing module, wherein the calling interface determining module is used for determining whether a calling interface corresponding to the map application exists in a storage area corresponding to a single-page application when a map calling instruction sent by the single-page application is received;
the download task confirming module is used for determining whether a first download task corresponding to the single-page application exists in a preset download task list if the calling interface does not exist in the storage area;
and the first task processing module is used for waiting for the execution of the first download task if the first download task exists in the download task list, and calling the downloaded calling interface to process the rendering tasks in the single-page application until the first download task is completed.
9. A map rendering device of a single-page application, characterized in that the map rendering device of the single-page application comprises a processor, a memory, and a map rendering program of the single-page application stored on the memory and executable by the processor, wherein the map rendering program of the single-page application, when executed by the processor, implements the steps of the map rendering method of the single-page application according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a map rendering program of a single-page application is stored, wherein the map rendering program of the single-page application, when executed by a processor, implements the steps of the map rendering method of the single-page application according to any one of claims 1 to 7.
CN202111155213.8A 2021-09-29 2021-09-29 Map rendering method, device, equipment and storage medium for single page application Active CN113821737B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111155213.8A CN113821737B (en) 2021-09-29 2021-09-29 Map rendering method, device, equipment and storage medium for single page application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111155213.8A CN113821737B (en) 2021-09-29 2021-09-29 Map rendering method, device, equipment and storage medium for single page application

Publications (2)

Publication Number Publication Date
CN113821737A true CN113821737A (en) 2021-12-21
CN113821737B CN113821737B (en) 2024-02-06

Family

ID=78915920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111155213.8A Active CN113821737B (en) 2021-09-29 2021-09-29 Map rendering method, device, equipment and storage medium for single page application

Country Status (1)

Country Link
CN (1) CN113821737B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090150795A1 (en) * 2007-12-11 2009-06-11 Microsoft Corporation Object model and user interface for reusable map web part
CN104111950A (en) * 2013-04-19 2014-10-22 腾讯科技(深圳)有限公司 Webpage image loading method and webpage image loading device
CN105243100A (en) * 2015-09-17 2016-01-13 百度在线网络技术(北京)有限公司 Map rendering method, and method and apparatus for providing rendering target information
CN109684574A (en) * 2018-08-20 2019-04-26 平安普惠企业管理有限公司 Page loading method, device, equipment and storage medium
CN109710716A (en) * 2018-12-24 2019-05-03 成都四方伟业软件股份有限公司 Map smoothness rendering method, terminal device and computer readable storage medium
CN110647597A (en) * 2018-06-11 2020-01-03 百度在线网络技术(北京)有限公司 Rendering method and device of electronic map
CN112231609A (en) * 2020-10-30 2021-01-15 深圳物讯科技有限公司 Method, device and storage medium for rapidly rendering map based on WebGIS map

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090150795A1 (en) * 2007-12-11 2009-06-11 Microsoft Corporation Object model and user interface for reusable map web part
CN104111950A (en) * 2013-04-19 2014-10-22 腾讯科技(深圳)有限公司 Webpage image loading method and webpage image loading device
CN105243100A (en) * 2015-09-17 2016-01-13 百度在线网络技术(北京)有限公司 Map rendering method, and method and apparatus for providing rendering target information
CN110647597A (en) * 2018-06-11 2020-01-03 百度在线网络技术(北京)有限公司 Rendering method and device of electronic map
CN109684574A (en) * 2018-08-20 2019-04-26 平安普惠企业管理有限公司 Page loading method, device, equipment and storage medium
CN109710716A (en) * 2018-12-24 2019-05-03 成都四方伟业软件股份有限公司 Map smoothness rendering method, terminal device and computer readable storage medium
CN112231609A (en) * 2020-10-30 2021-01-15 深圳物讯科技有限公司 Method, device and storage medium for rapidly rendering map based on WebGIS map

Also Published As

Publication number Publication date
CN113821737B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN108108181B (en) Function updating method and device of application program and computer readable storage medium
JP6571277B2 (en) Method and apparatus for loading terminal application
CN109857515B (en) Bridge communication method, device, equipment and computer readable storage medium
CN107783795B (en) Application program starting method and device, computer equipment and storage medium
CN107515764B (en) Application page opening method, terminal and computer readable storage medium
CN107818023B (en) Thread-based message processing method, intelligent device and storage medium
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
JP5004857B2 (en) Application update information providing system and application update information providing method
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN111475390A (en) Log collection system deployment method, device, equipment and storage medium
CN111124544A (en) Interface display method and device, electronic equipment and storage medium
CN110609755A (en) Message processing method, device, equipment and medium for cross-block chain node
CN111694620A (en) Interaction method, device and equipment of third-party service and computer storage medium
CN113626225B (en) Program calling method, terminal device and medium
CN112905209A (en) Application program updating method and device
CN113821737B (en) Map rendering method, device, equipment and storage medium for single page application
CN111158689A (en) Cross-system UI application generation method, device and computer-readable storage medium
CN111158777A (en) Component calling method and device and computer readable storage medium
CN114253441B (en) Method and device for enabling target function, storage medium and electronic device
CN107391132B (en) Method, device and equipment for target App to execute preset action
CN113867756A (en) Software upgrading method, terminal equipment and readable storage medium
CN111078571B (en) Test method for analog response, terminal equipment and computer readable storage medium
US20130332568A1 (en) Method of data processing by a navigation module
CN114301970A (en) Service calling method and device, electronic equipment and storage medium
CN113885957A (en) Configuration file processing method, terminal device, server and storage medium

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