CN113157330A - Method, device and storage medium for drawing graph on map layer - Google Patents
Method, device and storage medium for drawing graph on map layer Download PDFInfo
- Publication number
- CN113157330A CN113157330A CN202110043743.7A CN202110043743A CN113157330A CN 113157330 A CN113157330 A CN 113157330A CN 202110043743 A CN202110043743 A CN 202110043743A CN 113157330 A CN113157330 A CN 113157330A
- Authority
- CN
- China
- Prior art keywords
- data
- graphic
- drawn
- graph
- vertex
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 230000000007 visual effect Effects 0.000 claims abstract description 69
- 238000006243 chemical reaction Methods 0.000 claims abstract description 14
- 230000008859 change Effects 0.000 claims description 19
- 238000009877 rendering Methods 0.000 claims description 2
- 230000008569 process Effects 0.000 abstract description 22
- 238000004364 calculation method Methods 0.000 abstract description 13
- 238000010586 diagram Methods 0.000 description 6
- 238000011161 development Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 230000001788 irregular Effects 0.000 description 4
- 239000013598 vector Substances 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000007717 exclusion Effects 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000036541 health Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/05—Geographic models
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Geometry (AREA)
- Human Computer Interaction (AREA)
- Remote Sensing (AREA)
- Computer Graphics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a method, a device and a storage medium for drawing a graph on a map layer, wherein the method comprises the following steps: acquiring graphic data through a preset visual interface component layer, and taking the graphic data as graphic data to be drawn; and acquiring longitude and latitude data of the graphic data to be drawn, and drawing a graphic with the same shape as the graphic data to be drawn on the map layer through the longitude and latitude data. According to the embodiment, the operation process of the modified graph is placed on the visual interface component layer provided by the android system, so that the operation process of the modified graph and the map layer are extracted. The method and the device can effectively avoid the situation that excessive longitude and latitude conversion calculation is caused by the fact that too many touch points are generated due to the sliding of fingers in the process of changing the shape of the safe area by a user.
Description
Technical Field
The invention relates to the field of electronic maps, in particular to a method and a device for drawing a graph on a map layer and a storage medium.
Background
Along with the more sophisticated pursuit of health, safe positioning and entertainment experience by people, smart wearable devices are beginning to rapidly spread in the global market. The safety problem is one of the important problems to be considered and solved by the intelligent wearable device. This wearing equipment of writing of wrist-watch, bracelet, locator all has the function of setting up these irregular figures of safe region, can in time inform the user when child, pet walk out safe region. However, the security area is often an irregular figure, and when the user sets the security area, the user sets a corresponding shape area according to the actual situation, and then changes the shape of the figure corresponding to the security area according to the self requirement. Since the Android development kit (Android SDK) of the current google map (google map) does not have a direct Application Programming Interface (API) to change the shape of a drawn graphic by dragging various points on the shape of the drawn graphic. Therefore, if a user needs to change the graphic shape corresponding to the safe area on the google map, the terminal needs to record the positions of all the touch points of the user, then convert the positions into corresponding longitude and latitude on the map, and re-connect the touch points corresponding to the current finger to draw the corresponding graphic shape when the finger of the user stops moving, so that the change of the range of the safe area on the google map is realized. However, the user generates many points during the process of touching the screen and moving the map, which results in many extra and unnecessary latitude and longitude conversion calculations.
Thus, there is still a need for improvement and development of the prior art.
Disclosure of Invention
The present invention is to provide a method, an apparatus, and a storage medium for drawing a graphic on a map layer, aiming at solving the problem that when the graphic on the map layer is modified in the prior art, a lot of extra calculations are caused due to a touch screen and a lot of points generated in the process of moving a map.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, an embodiment of the present invention provides a method for drawing a graphic in a map layer, where the method includes:
acquiring graphic data through a preset visual interface component layer, and taking the graphic data as graphic data to be drawn;
and acquiring longitude and latitude data of the graphic data to be drawn, and drawing a graphic with the same shape as the graphic data to be drawn on a map layer through the longitude and latitude data.
In an embodiment, the obtaining of the graphic data, updating the original graphic data on a preset visual interface component layer according to the graphic data, and taking the graphic data as the graphic data to be drawn after the updating includes:
acquiring coordinate data of a touch point;
updating the coordinate data of the vertex of the original graph on the visual interface component layer according to the coordinate data of the touch point;
sequentially connecting the vertexes obtained after the updating is finished to obtain graph data;
and taking the graph data as graph data to be drawn.
In one embodiment, the updating, on the visual interface component layer, the coordinate data of the vertex of the original graph according to the coordinate data of the touch point includes:
comparing the coordinate data of the touch point with the coordinate data of the vertex of the original graph;
and if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, updating the coordinate data of the vertex of the original graph according to the coordinate data of the touch point.
In one embodiment, if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, updating the coordinate data of the vertex of the original graph according to the coordinate data of the touch point includes:
if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, acquiring the moving track information of the touch point;
determining corresponding coordinate data when the touch point stops moving according to the moving track information of the touch point;
and updating the coordinate data of the vertex of the original graph according to the corresponding coordinate data when the touch point stops moving.
In one embodiment, the updating, on the visual interface component layer, the coordinate data of the vertex of the original graph according to the coordinate data of the touch point further includes:
and if the coordinate data of the touch point is different from the coordinate data of the vertex of the original graph, not updating the coordinate data of the vertex of the original graph.
In one embodiment, the obtaining of the longitude and latitude data of the graphic data to be drawn, and drawing a graphic with a shape identical to that of the graphic data to be drawn on a map layer through the longitude and latitude data includes:
acquiring coordinate data of a vertex of the graph data to be drawn;
converting the coordinate data of the vertex of the graphic data to be drawn into longitude and latitude data, and obtaining the longitude and latitude data of the vertex of the graphic data to be drawn after the conversion is finished;
determining a standard geographic point corresponding to the vertex of the graphic data to be drawn on the map layer according to the longitude and latitude data of the vertex of the graphic data to be drawn;
and sequentially connecting the standard geographical points on the map layer to realize drawing the graph with the same shape as the data of the graph to be drawn on the map layer.
In one embodiment, the method further comprises:
acquiring scaling change data of a map layer, and updating the scaling size data of the original map layer according to the scaling change data of the map layer;
performing scaling operation on the visual interface component layer according to the updated scaling size data of the map layer;
and executing the method for drawing the graph on the map layer through the visual interface component layer obtained based on the scaling operation.
In an embodiment, the performing a scaling operation on the visual interface component layer according to the updated scaled size data of the map layer includes:
acquiring scaling size data of an original visual interface component layer;
taking the ratio of the updated map layer scaling data to the original visual interface component layer scaling data as the scaling multiple of the visual interface component layer;
and executing scaling operation on the visual interface component layer according to the scaling factor.
In a second aspect, an embodiment of the present invention further provides an apparatus for drawing a graphic on a map layer, where the apparatus includes:
the acquisition module is used for acquiring graphic data through a preset visual interface component layer and taking the graphic data as graphic data to be drawn;
and the drawing module is used for acquiring longitude and latitude data of the graphic data to be drawn and drawing a graphic with the same shape as the graphic data to be drawn on the map layer through the longitude and latitude data.
In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a plurality of instructions are stored, where the instructions are adapted to be loaded and executed by a processor to implement any one of the above steps of drawing a graphic on a map layer.
The invention has the beneficial effects that: the method comprises the steps of obtaining graphic data through a preset visual interface component layer, and using the graphic data as graphic data to be drawn; and acquiring longitude and latitude data of the graphic data to be drawn, and drawing a graphic with the same shape as the graphic data to be drawn on a map layer through the longitude and latitude data. According to the embodiment, the operation process of the modified graph is placed on the visual interface component layer provided by the android system, so that the operation process of the modified graph and the map layer are extracted. The method and the device can effectively avoid the situation that excessive longitude and latitude conversion calculation is caused by the fact that too many touch points are generated due to the sliding of fingers in the process of changing the shape of the safe area by a user.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for drawing a graphic on a map layer according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of acquiring data of a graph to be drawn according to an embodiment of the present invention.
Fig. 3 is a schematic flow chart of drawing a graph having the same shape as the data of the graph to be drawn on a map layer according to an embodiment of the present invention.
Fig. 4 is a schematic connection diagram of internal modules of an apparatus for drawing a graphic on a map layer according to an embodiment of the present invention.
Fig. 5 is a schematic block diagram of a terminal according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of a visual interface component layer and a map layer according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if directional indications (such as up, down, left, right, front, and back … …) are involved in the embodiment of the present invention, the directional indications are only used to explain the relative positional relationship between the components, the movement situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indications are changed accordingly.
With the development of electronic map technology and the perfection of various aspects of electronic maps, the current electronic maps have a powerful and comprehensive search and positioning function. With the development of computer technology, the storage of mass information is more and more efficient and low-cost, and it is easier for users to acquire electronic maps by accessing a network. These all make the range of electronic map application wider and wider, along with the increase of user's demand for electronic map, electronic map's function and usage are also abundant increasingly. One of the new functions is to combine the electronic map technology with the intelligent wearable device.
In particular, with the more sophisticated pursuit of health, secure positioning, and entertainment experiences by people, smart wearable devices have begun to rapidly spread in the global market. The safety problem is one of the important problems to be solved by the intelligent wearable device. The watch, the bracelet and the locator write and wear equipment have the function of setting irregular graphs of the safe area, and a user can be informed in time when children and pets walk out of the safe area. However, the security area is often an irregular figure, and when the user sets the security area, the user sets a corresponding shape area according to an actual situation, and then changes the shape of the figure corresponding to the security area according to the user's own requirements. Since the Android development kit (Android SDK) of the current google map (google map) does not have a direct Application Programming Interface (API) to change the shape of a drawn graphic by dragging various points on the shape of the drawn graphic. Therefore, if a user needs to change the graphic shape corresponding to the safe area on the google map, the terminal needs to record the positions of all the touch points of the user, then convert the positions into corresponding longitude and latitude on the map, and re-connect the lines to draw the corresponding graphic shape according to the touch points corresponding to the current finger when the finger of the user stops moving, so that the change of the range of the safe area on the google map is realized. However, the user may generate many points during the process of touching the screen and moving the map, which may cause many extra and unnecessary latitude and longitude conversion calculations.
Aiming at the defects in the prior art, the invention provides a method for drawing a graph on a map layer, which is characterized in that the operation process of modifying the graph is placed on a visual interface component layer (View) provided by an android system, so that the operation process of modifying the graph and the map layer are extracted. When the user resets the safety area, only the graph corresponding to the original safety area needs to be changed by sliding the finger on the visual interface component layer, and points generated by finger demarcation in the process cannot directly influence the map layer, so that the longitude and latitude conversion calculation is not needed. And acquiring longitude and latitude data of the graph drawn on the visual interface component layer only after the user finally confirms the new safe area, and then drawing the graph on the map layer. The method and the device can effectively avoid the situation that excessive longitude and latitude conversion calculation is caused by the fact that too many touch points are generated due to the sliding of fingers in the process of changing the shape of the safe area by a user.
As shown in fig. 1, this embodiment provides a method for drawing a graphic on a map layer, where the method includes the following steps:
and S100, acquiring graphic data through a preset visual interface component layer, and taking the graphic data as graphic data to be drawn.
Specifically, when the user needs to change the graph of the original secure area, if the graph shape corresponding to the original secure area is directly changed on the map layer, the touch point generated by the user during the finger sliding will be subjected to the latitude and longitude conversion calculation process, thereby consuming a large amount of calculation resources of the device. To avoid the above situation, as shown in fig. 6, a visual interface component layer (View) is preset in this embodiment, and the visual interface component layer provided by the android system includes menus, buttons, dialog boxes, and the like, which are base classes of all interface design components, and basically all high-level interface design components are implemented by inheriting visual interface component layer classes. A visual interface component layer occupies a rectangular area on a screen, is responsible for rendering the rectangular area, can also process events occurring in the rectangular area, and can set whether the area is visible or not and acquire a focus.
In this embodiment, the visual interface component layer is used as a drawing board for a user to perform graphic change on an original security area, so as to separate a graphic modification process of the user from a map layer. As the touch points generated on the visual interface component layer by the user do not need to be subjected to latitude and longitude conversion calculation, a large amount of calculation resources can be saved. The terminal obtains new graphic data drawn by a user through a preset visual interface component layer, and then the graphic data is used as the graphic data to be drawn for subsequent drawing on the map layer.
In one implementation, as shown in fig. 2, the step S100 includes the following steps:
step S110, acquiring coordinate data of a touch point;
step S120, updating coordinate data of a vertex of an original graph on the visual interface component layer according to the coordinate data of the touch point;
step S130, connecting vertexes obtained after updating in sequence to obtain graph data;
and step S140, using the graphic data as graphic data to be drawn.
Specifically, in order to acquire a graph corresponding to a new safety area drawn on a visual interface component layer by a user, in the embodiment, coordinate data of a touch point generated by the user through a touch screen is acquired first, and then coordinate data of a vertex of an original graph is updated on the visual interface component layer according to the coordinate data of the touch point.
In an implementation manner, in this embodiment, first, the coordinate data of the touch point needs to be compared with the coordinate data of the vertex of the original graph, and if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, the coordinate data of the vertex of the original graph is updated according to the coordinate data of the touch point. Specifically, if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, the movement track information of the touch point is acquired, the corresponding coordinate data when the touch point stops moving is determined according to the movement track information of the touch point, and the coordinate data of the vertex of the original graph is updated according to the corresponding coordinate data when the touch point stops moving. And if the coordinate data of the touch point is different from the coordinate data of the vertex of the original graph, not updating the coordinate data of the vertex of the original graph. In other words, the shape of the original graph is changed by changing the vertex of the original graph in the embodiment. If the user wants to change the shape of the original graphic, one of the vertices on the original graphic of the layer must be clicked on the visual interface component layer first, and then dragged until the vertex is moved to the position designated by the user, and then a new graphic is obtained, which corresponds to the new safety area range. If the user firstly clicks one vertex on the visual interface component layer which is not on the original graph of the layer, the touch event is not consumed, and the original graph is used as the range of the safety zone.
For example, as shown in fig. 6, the present embodiment first provides a regular hexagonal graph as an original graph corresponding to the safety region on a preset visual interface component layer by default, and then the user synchronously touches and moves vertices (points in fig. 6) on the original graph. When a user touches the screen, the terminal checks whether the initial Touch point coordinate data generated when the user finger is pressed down is one of the positions of the six vertexes of the regular hexagonal graph or not on the visual interface component layer through an on Touch Event method, if so, the vertex is controlled to move along with the user finger until the finger leaves the screen, and therefore a new vertex is obtained. And sequentially connecting the new vertexes obtained after the updating is finished to obtain graph data, thereby finishing the change of the original graph. Then, the graphic data is used as the graphic data to be drawn for subsequent drawing on the map layer, so that the change of the range of the safety region on the map layer can be really realized.
As shown in fig. 1, the method further comprises the steps of:
and S200, acquiring longitude and latitude data of the graph data to be drawn, and drawing a graph with the same shape as the graph data to be drawn on a map layer through the longitude and latitude data.
When a user draws a new graphic on the visual interface component layer, the graphic needs to be converted to the map layer to actually change the range of the safety area. Specifically, new graphic data drawn on the visual interface component layer by a user is used as graphic data to be drawn, and then a graphic with the same shape as the graphic data to be drawn is drawn on a map layer through a longitude and latitude conversion technology and used as a new safety area range.
In one implementation, as shown in fig. 3, the step S200 specifically includes the following steps:
step S210, coordinate data of a vertex of the graph data to be drawn are obtained;
step S220, converting the coordinate data of the vertex of the graphic data to be drawn into longitude and latitude data, and obtaining the longitude and latitude data of the vertex of the graphic data to be drawn after the conversion is finished;
step S230, determining a standard geographic point corresponding to the vertex of the to-be-drawn graph data on a map layer according to the longitude and latitude data of the vertex of the to-be-drawn graph data;
and S240, sequentially connecting the standard geographic points on a map layer to realize drawing a graph with the same shape as the data of the graph to be drawn on the map layer.
Specifically, the graphic data with the same shape as the graphic data to be drawn on the visual interface component layer is drawn on the map layer. Firstly, coordinate data of each vertex of the graphic data to be drawn are acquired on a visual interface component layer, then the acquired vertex coordinate data are converted into longitude and latitude data in a real geographic space, the longitude and latitude data of the vertex of the graphic data to be drawn are acquired after the conversion is finished, then standard geographic points corresponding to the vertices are found on a map layer according to the longitude and latitude data of the vertex, and then the standard geographic points are sequentially connected, so that a graphic with the same shape as the graphic data drawn on the visual interface component layer can be drawn on the geographic layer. In short, in this embodiment, the graph drawn by the user is converted from the visual interface component layer to the map layer by first determining the standard geographic points corresponding to the vertices of the graph on the visual interface component layer on the map layer, and then sequentially connecting the standard geographic points to obtain a closed-loop graph, where the graph is the range of the safe region reset by the user.
Since the scaling of the map may have a certain influence on the accuracy of the method for drawing a graph in a map layer provided in this embodiment, in an implementation manner, the method further includes: and acquiring scaling change data of the map layer, and updating the scaling size data of the original map layer according to the scaling change data of the map layer. And then, performing scaling operation on the visual interface component layer according to the updated scaling size data of the map layer. In an implementation manner, the scaling data of an original visual interface component layer may be obtained, then a ratio of the updated scaling data of the map layer to the scaling data of the original visual interface component layer is used as a scaling factor of the visual interface component layer, and then a scaling operation is performed on the visual interface component layer according to the scaling factor. For example, after the map layer triggers the scaling change, if the scaling data of the current map layer is obtained as a, then the scaling data of the current visual interface component layer is obtained as b, and c is calculated as a/b, then c is the scaling factor adopted when the visual interface component layer needs to be scaled currently. And finally, executing the method for drawing the graph on the map layer through the visual interface component layer obtained based on the scaling operation.
In one implementation, to ensure that the graphical data rendered on the visual interface component layer is valid, i.e., the graph is closed-loop and no intersection of two lines occurs. It should be noted that the case where two lines intersect in the present embodiment refers to that two line segments intersect when there is a common point and the point is not an end point of any line segment. Therefore, in this embodiment, after the graphical data is acquired through the visual interface component layer, the graphical data needs to be detected and processedThe detection process comprises: one of the rapid exclusion test treatment and the straddle test treatment, or both the rapid exclusion test treatment and the straddle test treatment. Wherein the rapid rejection test treatment refers to: suppose that a line segment P1,P2Making a rectangle R for diagonal line, and then Q1,Q2The diagonal is made as a rectangle T, and when two rectangles do not intersect, the two line segments must not intersect, i.e., the rectangle intersects when the requirement of line segment intersection is satisfied. The straddle experiment refers to: condition 1: if a line segment P1P2Stride over line segment Q1Q2Then P1,P2Is distributed on the line segment Q1Q2Two sides of (P) ((P)1-Q1)×(Q2-Q1))*((Q2-Q1)×(P2-Q1))>0 (note that "x" is in the sense of cross multiplication, and "x" is a dot multiplication). According to (P)1-Q1)×(Q2-Q1) Obtain the line segment Q1P1Heel segment Q1Q2Direction of vector of cross product result, (Q)2-Q1)×(P2-Q1) The same will also result in the outlet section Q1Q2And a line segment Q1P2The directions of the vectors of the cross-product result are only such that the dot product result of the two result vectors is greater than 0, i.e. the directions of the two result vectors coincide, P1,P2Will be distributed on the line segment Q1Q2On both sides of the frame. Condition 2: q1Q2Is distributed at P1P2The conditions on both sides are ((Q)1-P1)×(P2-P1))*((P2-P1) ×(Q2-P1))>0. When the above two conditions are satisfied simultaneously, the line segment Q1Q2Heel segment P1P2Will intersect. Whether the line segments are intersected or not can be judged by converting formulas in the two conditions into expressions obtained after coordinate operation in programming and writing the expressions into a programming language.
Based on the foregoing embodiment, the present invention further provides an apparatus for drawing a graphic on a map layer, as shown in fig. 4, the apparatus includes:
the acquisition module 01 is used for acquiring graphic data through a preset visual interface component layer, and taking the graphic data as graphic data to be drawn;
and the drawing module 02 is used for acquiring longitude and latitude data of the graphic data to be drawn and drawing a graphic with the same shape as the graphic data to be drawn on the map layer through the longitude and latitude data.
Based on the above embodiment, the present invention further provides an intelligent terminal, and a schematic block diagram thereof may be as shown in fig. 5. The intelligent terminal comprises a processor, a memory, a network interface and a display screen which are connected through a system bus. Wherein, the processor of the intelligent terminal is used for providing calculation and control capability. The memory of the intelligent terminal comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the intelligent terminal is used for being connected and communicated with an external terminal through a network. The computer program is executed by a processor to implement a method of drawing graphics at a map layer. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
It will be understood by those skilled in the art that the block diagrams are only block diagrams of some of the structures associated with the inventive arrangements and do not constitute a limitation of the intelligent terminal to which the inventive arrangements are applied, and that a particular intelligent terminal may include more or less components than those shown, or some of the components may be combined, or have a different arrangement of components.
In one implementation, one or more programs are stored in a memory of the smart terminal and configured to be executed by one or more processors include instructions for performing a method of drawing graphics in a map layer.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when executed. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
In summary, the present invention discloses a method for drawing a graphic on a map layer, where the method includes: acquiring graphic data through a preset visual interface component layer, and taking the graphic data as graphic data to be drawn; and acquiring longitude and latitude data of the graphic data to be drawn, and drawing a graphic with the same shape as the graphic data to be drawn on the map layer through the longitude and latitude data. According to the method and the device, the operation process of the modified graph and the map layer are extracted by placing the operation process of the modified graph on the visual interface component layer provided by the android system. The method and the device can effectively avoid the situation that in the process of changing the shape of the safe area, the finger slides to generate too many touch points, so that the conversion calculation of the longitude and the latitude is excessive.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.
Claims (10)
1. A method for drawing a graphic in a map layer, the method comprising:
acquiring graphic data through a preset visual interface component layer, and taking the graphic data as graphic data to be drawn;
and acquiring longitude and latitude data of the graphic data to be drawn, and drawing a graphic with the same shape as the graphic data to be drawn on the map layer through the longitude and latitude data.
2. The method according to claim 1, wherein the obtaining of the graphic data updates original graphic data on a preset visual interface component layer according to the graphic data, and the using of the graphic data as the graphic data to be drawn after the updating comprises:
acquiring coordinate data of a touch point;
updating the coordinate data of the vertex of the original graph on the visual interface component layer according to the coordinate data of the touch point;
sequentially connecting the vertexes obtained after the updating is finished to obtain graph data;
and taking the graph data as graph data to be drawn.
3. The method according to claim 2, wherein the updating the coordinate data of the vertex of the original graph according to the coordinate data of the touch point on the visual interface component layer comprises:
comparing the coordinate data of the touch point with the coordinate data of the vertex of the original graph;
and if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, updating the coordinate data of the vertex of the original graph according to the coordinate data of the touch point.
4. The method according to claim 3, wherein if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, the updating the coordinate data of the vertex of the original graph according to the coordinate data of the touch point comprises:
if the coordinate data of the touch point is the same as the coordinate data of the vertex of the original graph, acquiring the moving track information of the touch point;
determining corresponding coordinate data when the touch point stops moving according to the moving track information of the touch point;
and updating the coordinate data of the vertex of the original graph according to the corresponding coordinate data when the touch point stops moving.
5. The method according to claim 3, wherein the updating the coordinate data of the vertices of the original graphic according to the coordinate data of the touch points on the visual interface component layer further comprises:
and if the coordinate data of the touch point is different from the coordinate data of the vertex of the original graph, not updating the coordinate data of the vertex of the original graph.
6. The method according to claim 1, wherein the obtaining of longitude and latitude data of the graphic data to be drawn, and drawing a graphic with a shape identical to that of the graphic data to be drawn on the map layer through the longitude and latitude data comprises:
acquiring coordinate data of a vertex of the graph data to be drawn;
converting the coordinate data of the vertex of the graphic data to be drawn into longitude and latitude data, and obtaining the longitude and latitude data of the vertex of the graphic data to be drawn after the conversion is finished;
determining a standard geographic point corresponding to the vertex of the graphic data to be drawn on a map layer according to the longitude and latitude data of the vertex of the graphic data to be drawn;
and sequentially connecting the standard geographical points on the map layer to realize drawing the graph with the same shape as the data of the graph to be drawn on the map layer.
7. A method for drawing a graphic on a map layer according to claim 1, further comprising:
acquiring scaling change data of a map layer, and updating the scaling size data of the original map layer according to the scaling change data of the map layer;
performing scaling operation on the visual interface component layer according to the updated scaling size data of the map layer;
and executing the method for drawing the graph on the map layer through the visual interface component layer obtained based on the scaling operation.
8. The method according to claim 7, wherein said performing a scaling operation on said visual interface component layer according to the updated map layer scaling size data comprises:
acquiring scaling size data of an original visual interface component layer;
taking the ratio of the updated map layer scaling data to the original visual interface component layer scaling data as the scaling multiple of the visual interface component layer;
and executing scaling operation on the visual interface component layer according to the scaling factor.
9. An apparatus for rendering graphics in a map layer, the apparatus comprising:
the acquisition module is used for acquiring graphic data through a preset visual interface component layer and taking the graphic data as graphic data to be drawn;
and the drawing module is used for acquiring longitude and latitude data of the graphic data to be drawn and drawing a graphic with the same shape as the graphic data to be drawn on the map layer through the longitude and latitude data.
10. A computer readable storage medium having stored thereon a plurality of instructions adapted to be loaded and executed by a processor to perform the steps of drawing a graphic in a map layer according to any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110043743.7A CN113157330A (en) | 2021-01-13 | 2021-01-13 | Method, device and storage medium for drawing graph on map layer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110043743.7A CN113157330A (en) | 2021-01-13 | 2021-01-13 | Method, device and storage medium for drawing graph on map layer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113157330A true CN113157330A (en) | 2021-07-23 |
Family
ID=76878629
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110043743.7A Pending CN113157330A (en) | 2021-01-13 | 2021-01-13 | Method, device and storage medium for drawing graph on map layer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113157330A (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010035880A1 (en) * | 2000-03-06 | 2001-11-01 | Igor Musatov | Interactive touch screen map device |
US20040176908A1 (en) * | 2003-03-07 | 2004-09-09 | Keiichi Senda | Map displaying apparatus |
US20130342545A1 (en) * | 2012-06-22 | 2013-12-26 | Google Inc. | Displaying map layers in order |
US20150339038A1 (en) * | 2014-05-21 | 2015-11-26 | Jacoh Llc | System and method for capturing occluded graphical user interfaces |
US20160078650A1 (en) * | 2013-03-21 | 2016-03-17 | Geo Techinical Laboratory Co., Ltd. | Drawing data generation device and drawing device |
CN105677818A (en) * | 2015-12-31 | 2016-06-15 | 华南师范大学 | Drawing method and system based on mobile positioning and electronic map |
US20170052655A1 (en) * | 2015-08-17 | 2017-02-23 | Palantir Technologies Inc. | Interactive geospatial map |
CN110415315A (en) * | 2019-06-27 | 2019-11-05 | 五八有限公司 | Touch method, apparatus, terminal and the storage medium in map making region |
CN110634171A (en) * | 2019-02-01 | 2019-12-31 | 天津完美引力科技有限公司 | Device and method for drawing map |
CN111275730A (en) * | 2020-01-13 | 2020-06-12 | 平安国际智慧城市科技股份有限公司 | Method, device and equipment for determining map area and storage medium |
CN111815740A (en) * | 2020-07-27 | 2020-10-23 | 城云科技(中国)有限公司 | Map drawing method, system, terminal and storage medium |
CN111949359A (en) * | 2020-08-24 | 2020-11-17 | 浙江万朋教育科技股份有限公司 | Method for drawing and displaying school district enrollment range based on Baidu map API |
-
2021
- 2021-01-13 CN CN202110043743.7A patent/CN113157330A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010035880A1 (en) * | 2000-03-06 | 2001-11-01 | Igor Musatov | Interactive touch screen map device |
US20040176908A1 (en) * | 2003-03-07 | 2004-09-09 | Keiichi Senda | Map displaying apparatus |
US20130342545A1 (en) * | 2012-06-22 | 2013-12-26 | Google Inc. | Displaying map layers in order |
US20160078650A1 (en) * | 2013-03-21 | 2016-03-17 | Geo Techinical Laboratory Co., Ltd. | Drawing data generation device and drawing device |
US20150339038A1 (en) * | 2014-05-21 | 2015-11-26 | Jacoh Llc | System and method for capturing occluded graphical user interfaces |
US20170052655A1 (en) * | 2015-08-17 | 2017-02-23 | Palantir Technologies Inc. | Interactive geospatial map |
CN105677818A (en) * | 2015-12-31 | 2016-06-15 | 华南师范大学 | Drawing method and system based on mobile positioning and electronic map |
CN110634171A (en) * | 2019-02-01 | 2019-12-31 | 天津完美引力科技有限公司 | Device and method for drawing map |
CN110415315A (en) * | 2019-06-27 | 2019-11-05 | 五八有限公司 | Touch method, apparatus, terminal and the storage medium in map making region |
CN111275730A (en) * | 2020-01-13 | 2020-06-12 | 平安国际智慧城市科技股份有限公司 | Method, device and equipment for determining map area and storage medium |
CN111815740A (en) * | 2020-07-27 | 2020-10-23 | 城云科技(中国)有限公司 | Map drawing method, system, terminal and storage medium |
CN111949359A (en) * | 2020-08-24 | 2020-11-17 | 浙江万朋教育科技股份有限公司 | Method for drawing and displaying school district enrollment range based on Baidu map API |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11321925B2 (en) | Mixed-reality system, program, method, and portable terminal device | |
CN109753641B (en) | Method and device for changing object position, electronic equipment and storage medium | |
US20170177196A1 (en) | Providing selection areas for selectable objects in graphical interface | |
CN108156510B (en) | Page focus processing method and device and computer readable storage medium | |
CN103577030A (en) | Method and system for displaying interfaces of windows of browsers | |
CN112748843A (en) | Page switching method and device, computer equipment and storage medium | |
CN112099789A (en) | Human-computer interaction design method, device, equipment and storage medium | |
TWI671675B (en) | Information display method and device | |
CN111228816A (en) | Scene layout method and device in game | |
KR20230163921A (en) | Control method, device, equipment and storage medium for interactive reproduction of target object | |
CN110471700B (en) | Graphic processing method, apparatus, storage medium and electronic device | |
US10573033B2 (en) | Selective editing of brushstrokes in a digital graphical image based on direction | |
CN111580728B (en) | Method and device for dynamically plotting multiple military standard types based on state mode | |
CN113157330A (en) | Method, device and storage medium for drawing graph on map layer | |
CN108665525B (en) | Method for calculating virtual camera field angle based on engine and storage medium | |
CN108073339B (en) | Floating layer display method, client and electronic equipment | |
CN114820878B (en) | Image editing method and device | |
CN111024113A (en) | GMap-based navigation path direction arrow drawing method, system and equipment | |
CN108776669B (en) | Map display method, map display device, computer device and storage medium | |
US20180143747A1 (en) | User interface device and method for displaying screen of user interface device | |
CN110019492B (en) | Information display method and device | |
CN115033226A (en) | Page display method and device, terminal equipment and computer readable storage medium | |
CN115619904A (en) | Image processing method, device and equipment | |
CN111258576A (en) | Interface generation method and device, electronic equipment and computer storage medium | |
CN109189537A (en) | The dynamic display method of page info calculates equipment and computer 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210723 |
|
RJ01 | Rejection of invention patent application after publication |