CN112083846A - Method and device for detecting click area of map display mark and electronic equipment - Google Patents

Method and device for detecting click area of map display mark and electronic equipment Download PDF

Info

Publication number
CN112083846A
CN112083846A CN202010946216.2A CN202010946216A CN112083846A CN 112083846 A CN112083846 A CN 112083846A CN 202010946216 A CN202010946216 A CN 202010946216A CN 112083846 A CN112083846 A CN 112083846A
Authority
CN
China
Prior art keywords
area
click
determining
map display
edge
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
Application number
CN202010946216.2A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010946216.2A priority Critical patent/CN112083846A/en
Publication of CN112083846A publication Critical patent/CN112083846A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/80Creating or modifying a manually drawn or painted image using a manual input device, e.g. mouse, light pen, direction keys on keyboard

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a method and a device for detecting a map display mark clicking area and electronic equipment, and relates to the technical field of deep learning. The specific implementation scheme is as follows: receiving an input operation; determining a click position according to the input operation; determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark; the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons. Because the external area is a rectangular area, the mode of judging whether the click position is located in the rectangular area is simple and convenient, and the electronic equipment can determine that the click position is located outside the click area by determining that the click position is located outside the external area, so that the judgment speed of judging whether the click position is located in the click area can be improved.

Description

Method and device for detecting click area of map display mark and electronic equipment
Technical Field
The present application relates to a map scene technology in the field of computer technologies, and in particular, to a method and an apparatus for detecting a click area of a map display mark, and an electronic device.
Background
Currently, when a click event of a map display mark (e.g., a map bubble) is processed, whether a click position is located in a click area of the map display mark is detected, and then event processing is performed on a condition that the click position is located in the click area. Since the map display markers are regularly shaped, e.g., rectangular or circular, etc., the manner in which they are calculated when determining whether the click location is within the click region is relatively easy.
Disclosure of Invention
The disclosure provides a method and a device for detecting a click area of a map display mark and electronic equipment.
According to a first aspect of the present disclosure, there is provided a method for detecting a click area of a map display mark, including:
receiving an input operation;
determining a click position according to the input operation;
determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark;
the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons.
According to a second aspect of the present disclosure, there is provided a map display mark click region detection apparatus including:
the receiving module is used for receiving input operation;
the first determining module is used for determining a click position according to the input operation;
the second determining module is used for determining whether the click position is positioned in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark;
the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the first aspects.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of the first aspects.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flowchart of a method for detecting a clicked area of a map display marker provided in an embodiment of the present application;
FIG. 2 is another flowchart of a method for detecting a clicked area of a map display marker provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of determining a minimum bounding rectangle provided by an embodiment of the present application;
fig. 4 is a structural diagram of a map display mark click area detection apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing a method for detecting a clicked area of a map display marker according to an embodiment of the present disclosure.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1, fig. 1 is a flowchart of a method for detecting a clicked area of a map display marker provided in an embodiment of the present application, and as shown in fig. 1, the embodiment provides a method for detecting a clicked area of a map display marker, which is applied to an electronic device, and includes the following steps:
step 101, receiving an input operation.
And step 102, determining a click position according to the input operation.
103, determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the circumscribed area of the map display mark; the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons.
In this embodiment, the map display mark is displayed on the map, and the map display mark may be a bubble. The bubble map takes the map outline as the background, the size of data can be reflected by bubbles attached to the map, and the size and the distribution range of related data indexes of countries or regions can be visually displayed. For example, the bubble map can show the passenger flow of tourist attractions in each region, or show the per-capita income in each region, and the like.
The input operation may be a click operation on the map, or a short-distance slide operation. In the case of the slide operation, the end position of the slide trajectory may be determined as the click position.
The circumscribed area of the map display mark is a minimum circumscribed rectangular area of the clicked area of the map display mark, and the clicked area is an area formed by polygons.
Whether the input operation of the user is responded is determined by determining whether the click position is located in the click area of the map display mark, and if the click position is located in the click area of the map display mark, the input operation of the user is responded, such as prompt information or statistical information is displayed.
Because the external area is the minimum external rectangle area of the click area of the map display mark and the minimum external rectangle is the regular area, the electronic equipment can quickly judge whether the click position is located in the regular area. If the click position is located outside the circumscribed area, the click position is also located outside the click area of the map display mark; and if the click position is located in the circumscribed area, further judging whether the click position is located in the click area of the map display mark.
In this embodiment, the electronic device may determine that the click position is located outside the click region by determining that the click position is located outside the external region, and since the external region is a rectangular region, the manner of determining whether the click position is located in the rectangular region is simple and convenient, and the determination speed may be increased. Only under the condition that the click position is located in the circumscribed area, whether the click position is located in the click area or not is further determined according to the position relation between the click position and the click area. Compared with the mode of directly judging whether the click position falls in the click area in the prior art, the mode in the embodiment can directly determine that the click position is also located outside the click area for the click position located outside the external area, and different modes directly judge whether the click position falls in the click area, so that the operation process is simplified, and the judgment speed is increased.
The embodiment can be applied to map panoramic scenes, and after the bubbles around the panorama are drawn, the quick detection of the clicking areas of the bubbles and the efficient processing of the bubble clicking events are realized.
In this embodiment, the electronic device receives an input operation; determining a click position according to the input operation; determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark; the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons. Because the external area is a rectangular area, the mode of judging whether the click position is located in the rectangular area is simple and convenient, the electronic equipment can determine that the click position is located outside the click area by determining that the click position is located outside the external area, only under the condition that the click position is located in the external area, whether the click position is located in the click area needs to be further determined, and the judgment speed of whether the click position is located in the click area can be improved.
In an embodiment of the present application, the step 103 of determining whether the click position is located in the click area of the map display mark according to a position relationship between the click position and a circumscribed area of the map display mark includes:
if the click position is located in the foreign area, determining that the click position is not located in the click area of the map display mark;
and if the click position is located in the external connection area, determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the click area.
Because the external area is the minimum external rectangle area of the click area of the map display mark and the minimum external rectangle is the regular area, the electronic equipment can quickly judge whether the click position is located in the regular area. If the click position is not located in the external connection area, the click position is not located in the click area of the map display mark; if the click position is located in the outer connection area, whether the click position is located in the click area of the map display mark needs to be further judged.
In this embodiment, if the click position is located in the external connection area, it is determined that the click position is not located in the click area of the map display mark; and if the click position is located in the external connection area, determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the click area. That is to say, the electronic device may determine that the click position is located outside the click region by determining that the click position is located outside the external region, and since the external region is a rectangular region, it is simple to determine whether the click position is located in the rectangular region, and only under the condition that the click position is located within the external region, it may be further determined whether the click position is located within the click region according to the position relationship between the click position and the click region, and the determination speed may be increased by the determination method.
The traditional detection of the click area needs a lot of time to judge the topological relation so as to determine whether the click position is located in the click area. The application provides a new mode for determining whether a click position is located in a click area, and the specific implementation mode is as follows:
if the click position is located in the external area, determining whether the click position is located in the click area of the map display mark according to the position relationship between the click position and the click area, including:
determining a ray which takes the click position as a starting point and intersects the polygon;
if the number of the intersection points of the rays and the polygon is an odd number, determining that the click position is located in a click area of the map display mark;
and if the number of the intersection points of the rays and the polygon is an even number, determining that the click position is not located in the click area of the map display mark.
In this embodiment, a ray intersecting the polygon with the click position as the starting point is determined, and the ray and the click region are located on the same plane. And taking a position point on a certain edge of the polygon as a second point, and determining the ray as the ray which takes the click position as a starting point and passes through the second point.
And if the number of the intersection points of the rays and the polygon is an odd number, determining that the click position is located in the click area of the map display mark, and if the number of the intersection points of the rays and the polygon is an even number, determining that the click position is not located in the click area of the map display mark. In this embodiment, the number of intersections between the ray and the polygon may be understood as the total number of intersections between the ray and each edge of the polygon, where the intersection between the ray and the edge of the polygon cannot be an end point of the edge, and if the intersection is an end point, a ray intersecting the polygon with the click position as a starting point may be newly determined, and then the number of intersections between the new ray and the polygon may be determined.
In the implementation, the ray which takes the click position as a starting point and intersects with the polygon is determined; if the number of the intersection points of the rays and the polygon is an odd number, determining that the click position is located in a click area of the map display mark; if the number of the intersection points of the rays and the polygon is an even number, the click position is determined not to be located in the click area of the map display mark, whether the click position is located in the click area of the map display mark or not can be determined, the determination method is simple, the calculation amount is low, and the determination speed can be improved.
In an embodiment of the present application, if the number of intersections between the ray and the polygon is an odd number, determining that the click position is located in the click area of the map display mark includes:
for each first edge of the polygon, determining whether a straight line where the first edge is located intersects with the ray;
if the straight line where the first edge is located is determined to be intersected with the ray, determining whether the intersection point is between two end points of the first edge;
if the intersection point is between the two end points of the first edge, accumulating and counting the number of the intersection points of the polygon;
and if the result of the accumulated counting is an odd number, determining that the click position is located in the click area of the map display mark.
When the number of the intersection points of the rays and the polygon is determined, traversing each edge of the polygon in sequence, determining the number of the intersection points of each edge and the rays, wherein the sum of the number of the intersection points of the rays and each edge is the number of the intersection points of the rays and the polygon.
For each first edge of the polygon, determining whether a straight line where the first edge is located intersects with the ray, and when determining whether the straight line where the first edge is located intersects with the ray, specifically, the determining may include:
obtaining a first vector, wherein the first vector is a vector which takes the click position as a starting point and takes the direction of the ray as a direction;
for each first edge of the polygon, calculating a vector product of the first vector and a second vector, wherein the second vector is a vector which takes one end point of the first edge as a starting point and is parallel to the first edge;
and if the vector product is not zero, determining that the straight line where the first edge is located is intersected with the ray.
In the above, when determining whether the straight line where the first edge is located intersects with the ray, a vector product operation may be used for determining, that is, first obtaining a first vector and a second vector, then calculating a vector product of the first vector and the second vector, and if the vector product is a zero vector, it indicates that the first vector and the second vector do not intersect; if the vector product is not a zero vector, the first vector and the second vector are intersected.
The first vector is a vector taking the click position as a starting point and the direction of the ray as a direction, and the first vector can be a unit vector; the second vector is a vector which takes one end point of the first edge as a starting point and is parallel to the first edge, and the second vector can also be a unit vector.
Whether the straight line where the first edge is located is intersected with the ray or not is determined by calculating the vector product of the first vector and the second vector, so that the operation process can be simplified, and the operation efficiency can be improved.
If the straight line where the first edge is located is determined to be intersected with the rays, whether the intersection point is between two end points of the first edge is further determined, if the intersection point is between the two end points of the first edge, the number of the intersection points of the polygon is counted in an accumulating mode, namely 1 is accumulated, if the intersection point is at the end point position of the first edge, a ray which is intersected with the polygon by taking the click position as a starting point can be determined again, and then the number of the intersection points of a new ray and the polygon is determined.
And processing each first edge of the polygon in the above way until each first edge of the polygon is processed, and finally obtaining the number of intersection points of the ray and the polygon, namely the result of accumulated counting.
And if the result of the accumulated counting is an odd number, determining that the click position is located in the click area of the map display mark, and if the result of the accumulated counting is an even number, determining that the click position is located outside the click area of the map display mark.
In this embodiment, for each first edge of the polygon, determining whether a straight line where the first edge is located intersects with the ray; if the straight line where the first edge is located is determined to be intersected with the ray, determining whether the intersection point is between two end points of the first edge; if the intersection point is between the two end points of the first edge, accumulating and counting the number of the intersection points of the polygon; if the result of the accumulated counting is an odd number, the click position is determined to be located in the click area of the map display mark, and the method for determining whether the click position is located in the click area has low calculation amount and can improve the judgment speed.
The following description will be given in detail with reference to the map panoramic bubble as an example, as shown in fig. 2.
And step 11, calculating the coordinates of each vertex of the polygon of the click area, and mapping the coordinates into a coordinate system of the screen.
And (3) calculating the coordinates of each vertex of the bubble click area relative to the origin by taking the upper left corner of the panoramic bubble as the origin (0, 0), wherein the four vertices of the quadrangle R are respectively: a (aX, aY), B (bX, bY), C (cX, cY) and D (dX, dY);
after the bubble is drawn in the panoramic image layer of the map, the coordinates of each vertex relative to the screen origin are converted according to the relative coordinate position of the bubble on the screen, and if the coordinates of the panoramic bubble on the screen are (100 ), the coordinates of the four vertices of the panoramic bubble click area R are respectively: a1(aX +100, aY +100), B1(bX +100, bY +100), C1(cX +100, cY +100), and D1(dX +100, dY +100), as shown in fig. 3.
When the user clicks a coordinate point p (xP, yP) on the screen, the relationship of p to the bubble clickable area R can be calculated in the following manner.
And step 12, detecting the minimum circumscribed rectangle.
Firstly, sorting four vertexes of R according to the abscissa to obtain a minimum abscissa cX +100 and a maximum abscissa bX + 100; on the basis of horizontal coordinate sorting, according to the vertical coordinate sorting, obtaining a minimum vertical coordinate dY +100 and a maximum vertical and horizontal coordinate bY +100, and after obtaining a final sequence, making four vertexes of a minimum circumscribed polygon R ', R' as (cX +100, bY +100), (bX +100, bY +100), (cX +100, dY +100) and (bX +100, dY + 100). As shown in FIG. 3, the area indicated by the dotted line in the figure is the minimum circumscribed rectangle R'.
Judging whether the point p is in the interior of R', if so, continuously judging whether the point p is in the interior of R, wherein the judging mode is as follows:
and step 13, detecting the top point superposition.
Introducing a ray lp from the point p, wherein the ray lp passes through R, traversing and counting the number of intersection points of each edge of R and lp, and the judgment mode of each edge is as follows:
for each edge of R, acquiring the vertexes of the edge, such as vertexes A1 and B1 of the edge A1B1, judging whether A1 and B1 coincide with lp or not, if so, coinciding lp with the edge A1B1, and continuously judging whether the next edge coincides with the ray or not; otherwise, carrying out the next step;
and step 14, detecting the intersection.
Whether the ray lp is intersected with the straight line where the side A1B1 is located or not is judged, if so, the next step is carried out, otherwise, the ray lp and the side A1B1 have no intersection point, and whether the next side is overlapped with the ray or not is judged continuously;
judging whether the intersection point of the ray lp and the straight line of the side A1B1 is in the segment of the side A1B1 or not, and processing the intersection point by using a vector product, namely a vector lp '(namely a first vector) and a vector A1B 1'
(namely a second vector) performing vector product operation to obtain a normal vector n of the two vectors, wherein if the normal vector n is a zero vector, the vector lp 'and the vector A1B 1' are collinear and do not intersect; if the normal vector n is not zero, then determine whether the intersection is inside the segment of the side A1B1, if the intersection is inside the segment of the side A1B1, the intersection count is incremented by 1.
And step 15, counting the number of the intersection points, and judging the relationship between the click position p and the click region R.
And (4) counting the number of intersection points of the points p and each side of the R, wherein if the number of intersection points is an even number, the point p is outside the R area, and if the number of intersection points is an odd number, the point p is inside the R area.
In the scheme in the embodiment, the points which are not in the minimum circumscribed rectangle area are quickly discharged by using the minimum circumscribed rectangle in the clicking area, in addition, the calculation of the line segment formula is replaced by the vector product operation, and whether the intersection point exists between the ray lp and the side A1B1 is determined, so that not only can the efficiency be improved, but also the clicking operation of the irregular area can be quickly detected.
Referring to fig. 4, fig. 4 is a structural diagram of a device for detecting a clicked area of a map display marker provided in an embodiment of the present application, and as shown in fig. 4, the embodiment provides a device 300 for detecting a clicked area of a map display marker, including:
a receiving module 301, configured to receive an input operation;
a first determining module 302, configured to determine a click position according to the input operation;
a second determining module 303, configured to determine whether the click position is located in a click area of the map display mark according to a position relationship between the click position and an external area of the map display mark;
the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons.
Further, the second determining module 303 includes:
the first determining submodule is used for determining that the clicking position is not located in the clicking area of the map display mark if the clicking position is not located in the outer area;
and the second determining submodule is used for determining whether the click position is positioned in the click area of the map display mark according to the position relation between the click position and the click area if the click position is positioned in the outer area.
Further, the second determining sub-module includes:
a first determining unit, configured to determine a ray with the click position as a starting point, where the ray and the click region are located on the same plane;
a second determining unit, configured to determine that the click position is located in a click area of the map display mark if the number of intersection points of the ray and the polygon is an odd number;
and the third determining unit is used for determining that the clicking position is not located in the clicking area of the map display mark if the number of the intersection points of the ray and the polygon is an even number.
Further, the second determining unit includes:
the first determining subunit is used for determining whether a straight line where the first edge is located intersects the ray or not for each first edge of the polygon;
the second determining subunit is used for determining whether the intersection point is between two end points of the first edge or not if the fact that the straight line where the first edge is located intersects the ray is determined;
a counting subunit, configured to count the number of intersection points of the polygon in an accumulated manner if the intersection point is located between two end points of the first edge;
and the third determining subunit is configured to determine that the click position is located in the click area of the map display mark if the result of the accumulated count is an odd number.
Further, the first determining subunit is configured to:
obtaining a first vector, wherein the first vector is a vector which takes the click position as a starting point and takes the direction of the ray as a direction;
for each first edge of the polygon, calculating a vector product of the first vector and a second vector, wherein the second vector is a vector which takes one end point of the first edge as a starting point and is parallel to the first edge;
and if the vector product is not zero, determining that the straight line where the first edge is located is intersected with the ray.
The map display mark clicked region detection apparatus 300 can implement each process implemented by the electronic device in the method embodiment shown in fig. 1, and is not described here again to avoid repetition.
The map display mark click area detection apparatus 300 according to the embodiment of the present application receives an input operation; determining a click position according to the input operation; determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark; the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons. Because the external area is a rectangular area, the mode of judging whether the click position is located in the rectangular area is simple and convenient, the electronic equipment can determine that the click position is located outside the click area by determining that the click position is located outside the external area, only under the condition that the click position is located in the external area, whether the click position is located in the click area needs to be further determined, and the judgment speed of whether the click position is located in the click area can be improved.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 5, the embodiment of the present application is a block diagram of an electronic device for detecting a click area of a map display marker. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 5, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the method of map display marker click area detection provided herein. A non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the method of map display marker click area detection provided herein.
The memory 502, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the receiving module 301, the first determining module 302, and the second determining module 303 shown in fig. 4) corresponding to the method for detecting a marker click region in the map display in the embodiments of the present application. The processor 501 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 502, that is, implements the method of detecting the map display mark click region in the above-described method embodiments.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of the electronic device detected from the map display mark click area, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 502 may optionally include memory remotely located from processor 501, and such remote memory may be connected over a network to an electronic device for map display marker click zone detection. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the method of map display marker click area detection may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus for detection of a map display marker hit area, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the input operation is received; determining a click position according to the input operation; determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark; the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons. Because the external area is a rectangular area, the mode of judging whether the click position is located in the rectangular area is simple and convenient, the electronic equipment can determine that the click position is located outside the click area by determining that the click position is located outside the external area, only under the condition that the click position is located in the external area, whether the click position is located in the click area needs to be further determined, and the judgment speed of whether the click position is located in the click area can be improved.
If the click position is located in the foreign area, determining that the click position is not located in the click area of the map display mark; and if the click position is located in the external connection area, determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the click area. That is to say, the electronic device can determine that the click position is located outside the click region by determining that the click position is located outside the external region, and since the external region is a rectangular region, the manner of determining whether the click position is located in the rectangular region is simple, and only under the condition that the click position is located within the external region, it can be further determined whether the click position is located within the click region according to the position relationship between the click position and the click region, and this determination manner can improve the determination speed.
Determining a ray which takes the click position as a starting point and intersects the polygon; if the number of the intersection points of the rays and the polygon is an odd number, determining that the click position is located in a click area of the map display mark; if the number of the intersection points of the rays and the polygon is an even number, the click position is determined not to be located in the click area of the map display mark, whether the click position is located in the click area of the map display mark or not can be determined, the determination method is simple, the calculation amount is low, and the determination speed can be improved.
Whether the straight line where the first edge is located is intersected with the ray or not is determined by calculating the vector product of the first vector and the second vector, so that the operation process can be simplified, and the operation efficiency can be improved.
For each first edge of the polygon, determining whether a straight line where the first edge is located intersects with the ray; if the straight line where the first edge is located is determined to be intersected with the ray, determining whether the intersection point is between two end points of the first edge; if the intersection point is between the two end points of the first edge, accumulating and counting the number of the intersection points of the polygon; if the result of the accumulated counting is an odd number, the click position is determined to be located in the click area of the map display mark, and the method for determining whether the click position is located in the click area has low calculation amount and can improve the judgment speed.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A method for detecting a map display mark clicking area comprises the following steps:
receiving an input operation;
determining a click position according to the input operation;
determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark;
the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons.
2. The method of claim 1, wherein the determining whether the click position is located within the click region of the map display marker according to a positional relationship between the click position and a circumscribed region of the map display marker comprises:
if the click position is not located in the foreign area, determining that the click position is not located in the click area of the map display mark;
and if the click position is located in the external connection area, determining whether the click position is located in the click area of the map display mark according to the position relation between the click position and the click area.
3. The method of claim 2, wherein if the click position is located in the circumscribing area, determining whether the click position is located in a click area of the map display marker according to a position relationship between the click position and the click area comprises:
determining a ray which takes the click position as a starting point and intersects the polygon;
if the number of the intersection points of the rays and the polygon is an odd number, determining that the click position is located in a click area of the map display mark;
and if the number of the intersection points of the rays and the polygon is an even number, determining that the click position is not located in the click area of the map display mark.
4. The method of claim 3, wherein the determining that the click location is located within the click region of the map display marker if the number of intersections of the ray with the polygon is odd comprises:
for each first edge of the polygon, determining whether a straight line where the first edge is located intersects with the ray;
if the straight line where the first edge is located is determined to be intersected with the ray, determining whether the intersection point is between two end points of the first edge;
if the intersection point is between the two end points of the first edge, accumulating and counting the number of the intersection points of the polygon;
and if the result of the accumulated counting is an odd number, determining that the click position is located in the click area of the map display mark.
5. The method of claim 4, wherein the determining, for each first edge of the polygon, whether the line on which the first edge lies intersects the ray comprises:
obtaining a first vector, wherein the first vector is a vector which takes the click position as a starting point and takes the direction of the ray as a direction;
for each first edge of the polygon, calculating a vector product of the first vector and a second vector, wherein the second vector is a vector which takes one end point of the first edge as a starting point and is parallel to the first edge;
and if the vector product is not zero, determining that the straight line where the first edge is located is intersected with the ray.
6. A detection apparatus for a map display marker click area, comprising:
the receiving module is used for receiving input operation;
the first determining module is used for determining a click position according to the input operation;
the second determining module is used for determining whether the click position is positioned in the click area of the map display mark according to the position relation between the click position and the external area of the map display mark;
the circumscribed area is a minimum circumscribed rectangular area of a clicked area of the map display mark, and the clicked area is an area formed by polygons.
7. The apparatus of claim 6, wherein the second determining means comprises:
the first determining submodule is used for determining that the clicking position is not located in the clicking area of the map display mark if the clicking position is not located in the outer area;
and the second determining submodule is used for determining whether the click position is positioned in the click area of the map display mark according to the position relation between the click position and the click area if the click position is positioned in the outer area.
8. The apparatus of claim 7, wherein the second determination submodule comprises:
a first determining unit, configured to determine a ray that intersects with the polygon and starts from the click position;
a second determining unit, configured to determine that the click position is located in a click area of the map display mark if the number of intersection points of the ray and the polygon is an odd number;
and the third determining unit is used for determining that the clicking position is not located in the clicking area of the map display mark if the number of the intersection points of the ray and the polygon is an even number.
9. The apparatus of claim 8, wherein the second determining unit comprises:
the first determining subunit is used for determining whether a straight line where the first edge is located intersects the ray or not for each first edge of the polygon;
the second determining subunit is used for determining whether the intersection point is between two end points of the first edge or not if the fact that the straight line where the first edge is located intersects the ray is determined;
a counting subunit, configured to count the number of intersection points of the polygon in an accumulated manner if the intersection point is located between two end points of the first edge;
and the third determining subunit is configured to determine that the click position is located in the click area of the map display mark if the result of the accumulated count is an odd number.
10. The apparatus of claim 9, wherein the first determining subunit is to:
obtaining a first vector, wherein the first vector is a vector which takes the click position as a starting point and takes the direction of the ray as a direction;
for each first edge of the polygon, calculating a vector product of the first vector and a second vector, wherein the second vector is a vector which takes one end point of the first edge as a starting point and is parallel to the first edge;
and if the vector product is not zero, determining that the straight line where the first edge is located is intersected with the ray.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202010946216.2A 2020-09-10 2020-09-10 Method and device for detecting click area of map display mark and electronic equipment Pending CN112083846A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010946216.2A CN112083846A (en) 2020-09-10 2020-09-10 Method and device for detecting click area of map display mark and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010946216.2A CN112083846A (en) 2020-09-10 2020-09-10 Method and device for detecting click area of map display mark and electronic equipment

Publications (1)

Publication Number Publication Date
CN112083846A true CN112083846A (en) 2020-12-15

Family

ID=73732403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010946216.2A Pending CN112083846A (en) 2020-09-10 2020-09-10 Method and device for detecting click area of map display mark and electronic equipment

Country Status (1)

Country Link
CN (1) CN112083846A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287250A (en) * 2020-12-25 2021-01-29 智道网联科技(北京)有限公司 Map engine anchor event response method and device
CN112819986A (en) * 2021-02-03 2021-05-18 广东共德信息科技有限公司 Attendance system and method
CN115439945A (en) * 2022-09-01 2022-12-06 光大科技有限公司 Position tracking processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887127A (en) * 2010-03-19 2010-11-17 深圳市同洲电子股份有限公司 Vehicle monitoring processing method and device and GPS (Global Positioning System) server and vehicle monitoring system
CN104462155A (en) * 2013-09-25 2015-03-25 高德软件有限公司 Point-of-interest set membership establishing method and device
US20150324373A1 (en) * 2014-05-09 2015-11-12 Edward-Robert Tyercha Querying Spatial Data in Column Stores Using Grid-Order Scans
CN108108489A (en) * 2018-01-12 2018-06-01 阿里巴巴集团控股有限公司 POI search methods and device based on geographical location
CN108681453A (en) * 2018-05-21 2018-10-19 京东方科技集团股份有限公司 The implementation method and device of engine map

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887127A (en) * 2010-03-19 2010-11-17 深圳市同洲电子股份有限公司 Vehicle monitoring processing method and device and GPS (Global Positioning System) server and vehicle monitoring system
CN104462155A (en) * 2013-09-25 2015-03-25 高德软件有限公司 Point-of-interest set membership establishing method and device
US20150324373A1 (en) * 2014-05-09 2015-11-12 Edward-Robert Tyercha Querying Spatial Data in Column Stores Using Grid-Order Scans
CN108108489A (en) * 2018-01-12 2018-06-01 阿里巴巴集团控股有限公司 POI search methods and device based on geographical location
CN108681453A (en) * 2018-05-21 2018-10-19 京东方科技集团股份有限公司 The implementation method and device of engine map

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287250A (en) * 2020-12-25 2021-01-29 智道网联科技(北京)有限公司 Map engine anchor event response method and device
CN112819986A (en) * 2021-02-03 2021-05-18 广东共德信息科技有限公司 Attendance system and method
CN115439945A (en) * 2022-09-01 2022-12-06 光大科技有限公司 Position tracking processing method and device

Similar Documents

Publication Publication Date Title
CN111401208B (en) Obstacle detection method and device, electronic equipment and storage medium
CN112083846A (en) Method and device for detecting click area of map display mark and electronic equipment
US11361005B2 (en) Method for processing map data, device, and storage medium
CN111623795B (en) Live-action navigation icon display method, device, equipment and medium
CN111737392B (en) Method, device, equipment and storage medium for merging building data
CN110929639B (en) Method, apparatus, device and medium for determining the position of an obstacle in an image
CN111626206A (en) High-precision map construction method and device, electronic equipment and computer storage medium
CN111340890B (en) Camera external parameter calibration method, device, equipment and readable storage medium
CN111368760B (en) Obstacle detection method and device, electronic equipment and storage medium
CN111693059B (en) Navigation method, device and equipment for roundabout and storage medium
CN112131335B (en) Lane-level map data processing method and device, electronic equipment and storage medium
US11380035B2 (en) Method and apparatus for generating map
CN111210490B (en) Electronic map construction method, device, equipment and medium
EP3842765A2 (en) Method and apparatus for displaying point of information of map, device, and readable storage medium
CN111652112A (en) Lane flow direction identification method and device, electronic equipment and storage medium
CN111858996B (en) Indoor positioning method and device, electronic equipment and storage medium
CN111666876A (en) Method and device for detecting obstacle, electronic equipment and road side equipment
CN111578951A (en) Method and device for generating information
CN111275827A (en) Edge-based augmented reality three-dimensional tracking registration method and device and electronic equipment
CN113011298B (en) Truncated object sample generation, target detection method, road side equipment and cloud control platform
CN111191619A (en) Method, device and equipment for detecting virtual line segment of lane line and readable storage medium
CN112634401B (en) Plane track drawing method, device, equipment and storage medium
CN111949816B (en) Positioning processing method, device, electronic equipment and storage medium
CN111400537B (en) Road element information acquisition method and device and electronic equipment
CN112508027A (en) Head model for instance segmentation, instance segmentation model, image segmentation method and device

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: 20201215

RJ01 Rejection of invention patent application after publication