CN109508134A - A kind of map label method and apparatus - Google Patents
A kind of map label method and apparatus Download PDFInfo
- Publication number
- CN109508134A CN109508134A CN201710826599.8A CN201710826599A CN109508134A CN 109508134 A CN109508134 A CN 109508134A CN 201710826599 A CN201710826599 A CN 201710826599A CN 109508134 A CN109508134 A CN 109508134A
- Authority
- CN
- China
- Prior art keywords
- map
- target
- mark object
- offset
- target mark
- 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
Classifications
-
- 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/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/0486—Drag-and-drop
-
- 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
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09B—EDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
- G09B29/00—Maps; Plans; Charts; Diagrams, e.g. route diagram
- G09B29/003—Maps
- G09B29/006—Representation of non-cartographic information on maps, e.g. population distribution, wind direction, radiation levels, air and sea routes
- G09B29/007—Representation of non-cartographic information on maps, e.g. population distribution, wind direction, radiation levels, air and sea routes using computer methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Mathematical Physics (AREA)
- Ecology (AREA)
- Business, Economics & Management (AREA)
- Educational Administration (AREA)
- Educational Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computer Hardware Design (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a kind of map label method and apparatus, storage medium, processor, this method comprises: forbidding itself drag function of the map when receiving the drag operation for the target mark object on map;At the end of the drag operation, the target labeling position of the target mark object on the map is determined;Save the corresponding relationship of target the mark object and the target labeling position;It can be seen that the present invention can realize the dragging for marking object to target by drag operation, so that it is determined that the target labeling position of the target mark object after pulling, realizes the dynamic label placement of to map, improve the convenience and practicability of mark.
Description
Technical field
The present invention relates to customized Cartographic Technique fields, more particularly relate to a kind of map label method and apparatus.
Background technique
With the arrival in mobile interchange epoch, more and more people complete the clothes based on geographical location by map
Business.
The maps interaction scenarios such as Internet of Things, applied geography, house property industry, wisdom traffic, logistics distribution, O2O become more next
More complicated and frequent, so that the dependence of user's to map also gradually increases, everybody begins to focus on the interbehavior of map label,
It is labeled by map to improve the usability of user's to map, for example, optimization Internet of Things equipment locating and businessman run a shop certainly
Plan, it is intuitive to show source of houses data and optimum transportation route etc..
Currently, being directed to the mark behavior of map, most of is all " the static notation methods " based on customized mark, i.e.,
User is labeled mark object according to notation methods provided by map document, and this notation methods, which can reflect out, have been positioned
The mark information of equipment or the trade company of addressing on map.
But in order to improve the practicability of mark and convenience, more users are wanted to by carrying out to mark object
Dynamic operation marks the free addressing of object to realize, and existing notation methods cannot achieve.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
State a kind of map label method and apparatus of problem.
A kind of map label method, this method comprises:
When receiving the drag operation for the target mark object on map, that forbids the map itself pulls function
Energy;
At the end of the drag operation, the target labeling position of the target mark object on the map is determined;
Save the corresponding relationship of target the mark object and the target labeling position.
Preferably, before receiving the drag operation for the target mark object on map, further includes:
Using the additional drag function of element that DOM DOM Document Object Model operating method is on the map, determining has institute
The element of drag function is stated as mark object.
Preferably, the target labeling position of the determination target mark object on the map, comprising:
Obtain the first offset between the base position outside the target mark object and the predetermined map;
Obtain the second offset between the first position and the base position on the predetermined map;
It is calculated between the target mark object and the first position based on first offset and second offset
Third offset;
The target labeling position of the target mark object on the map is determined using the third offset.
Preferably, at the end of the drag operation, this method further include:
Start itself drag function of the map;And
After starting itself drag function of the map, if the state of the map changes, the determining institute
State the target labeling position of target mark object on the map, further includes:
The third offset is converted to the geographical position coordinates of the target mark object;Wherein, the geographical location
Coordinate is the practical latitude and longitude coordinates that target marks object;
The geographical position coordinates are inverted to coordinate system locating for the map, obtain the target mark object in state
The coordinate position on the map after changing, on the map using the coordinate position as target mark object
Target labeling position.
Preferably, further includes:
The corresponding relationship of target mark object and the target labeling position is sent to server;
And/or by the target mark object and the target labeling position corresponding relationship be updated to outside the map
In the data of elements correlation.
A kind of map label device, the device include:
First receiving unit, for forbidding described when receiving the drag operation for the target mark object on map
Itself drag function of map;
Position units are determined, at the end of the drag operation, determining the target mark object on the map
Target labeling position;
Save location unit, for saving the corresponding relationship of target the mark object and the target labeling position.
Preferably, the determining position units, comprising:
First obtains module, at the end of the drag operation, obtain the target mark object with it is predetermined
The first offset between base position outside the map;
Second obtains module, for obtaining between first position and the base position on the predetermined map
Second offset;
First computing module marks object for calculating the target based on first offset and second offset
Third offset between the first position;
First determining module, for determining the mesh of the target mark object on the map using the third offset
Mark labeling position.
Preferably, the device further include:
Startup function unit, for starting itself drag function of the map at the end of the drag operation;
Status determining unit, for after starting itself drag function of the map, the state for detecting the map to be
It is no to change;
Correspondingly, the determining position units further include:
First conversion module, for when the state of the map changes, the third offset to be converted to institute
State the geographical position coordinates of target mark object;
First reversal block obtains institute for the geographical position coordinates to be inverted to coordinate system locating for the map
Coordinate position of the target mark object on the map after state changes is stated, using the coordinate position as the target
Mark the target labeling position of object on the map.
A kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein transported in described program
Equipment where controlling the storage medium when row executes as above a kind of described in any item map label methods.
A kind of processor, which is characterized in that the processor executes when described program is run and such as takes up an official post for running program
A kind of map label method described in one.
By above-mentioned technical proposal, a kind of map label method provided by the invention includes: when receiving on map
Target mark object drag operation when, forbid itself drag function of the map, at the end of the drag operation, determine
The target labeling position of the target mark object on the map, saves the target mark object and the target labeling position
Corresponding relationship, it can be seen that, the present invention can by drag operation realize to target mark object dragging, so that it is determined that pull
The target labeling position of target mark object afterwards, realizes the dynamic label placement of to map, improves the convenience of mark and practical
Property.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of flow diagram of map label method disclosed in one embodiment of the invention;
Fig. 2 shows a kind of flow diagrams of map label method disclosed in another embodiment of the present invention;
Fig. 3 a shows a kind of schematic diagram of offset disclosed in an application example of the invention;
Fig. 3 b shows another schematic diagram of offset disclosed in an application example of the invention;
Fig. 4 shows a kind of flow diagram of map label method disclosed in another embodiment of the present invention;
Fig. 5 shows the schematic diagram of offset after map state disclosed in an application example of the invention changes;
Fig. 6 shows a kind of structural schematic diagram of map label device disclosed in one embodiment of the invention;
Fig. 7 shows a kind of structural schematic diagram of determining position units disclosed in another embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
One embodiment of the invention discloses a kind of map label method, as shown in Figure 1, method includes the following steps:
Step 101: when receiving the drag operation for the target mark object on map, forbidding itself of the map
Drag function;
In the present invention, drag function can be added for the element on map in advance, so that in triggering for map
It, can be by the way that irremovable element, these elements can be referred to as to mark originally on drag operation moving map when mark behavior
Infuse object.That is, mark object is the element for being attached with drag function on map.Optionally, it is receiving for the target on map
Before the drag operation for marking object, further includes: utilize DOM (Document Object Model, DOM Document Object Model) operation side
Method is that the element on map adds drag function, and it is mark object that determining, which has the element of the drag function,.The DOM operating method
Operating method including Jquery UI operating method or javascript DOM.
The drag operation can operate to touch drag operation or mouse drag.
When determining that the mark behavior for map starts, determine that the dragging object of drag operation is target mark object, and
Forbid itself drag function of map.Wherein, it triggers there are many modes for the mark behavior of map, for example, can pass through
Click map on a certain specific keys mode trigger or to map on a certain element carry out predetermined operation when triggering,
The time for such as clicking a certain element reaches preset time, determines that triggering is directed to the mark behavior of map, and determines that the element is mesh
Mark mark object.
It should be noted that the current display area that itself drag function of map is map can be based on drag operation
The function of change, and itself drag function of map can not change the geographical position coordinates of the element on map.
Step 102: at the end of the drag operation, determining the target mark of the target mark object on the map
Position;
Wherein, when drag operation of the release for target mark object, determine that drag operation terminates, at the end of drag operation
Target mark object position is target labeling position of the target mark object on map.For example, user marks object to target
Drag operation is carried out, discharges, determines after target mark object is dragged to the second position on map by the first position on map
Drag operation terminates, which is that target marks target labeling position of the object on map.
Optionally, target labeling position can be manually entered by user;Certainly, in the present invention, system can also be counted automatically
Target labeling position is calculated, can be specifically discussed in detail later.
Step 103: saving the corresponding relationship of target the mark object and the target labeling position.
The corresponding relationship that object and target labeling position are marked by saving target is realized for the map after mark more
Newly.
In an alternative embodiment of the invention, this method further include: by target mark object pass corresponding with target labeling position
System is sent in server;And/or the corresponding relationship of target mark object and the target labeling position is updated to and institute
In the data for stating the outer elements correlation of map.
Wherein, server is sent to which realization is directed to by the corresponding relationship that target is marked object and target labeling position
The long-range update of map after mark.
With the data of element outside map can for the associated object of map, be managed collectively and tieed up for map
Shield.
It can be seen that in the present embodiment, when receiving the drag operation for the target mark object on map, forbidding
Itself drag function of the map determines target mark object on the map at the end of the drag operation
Target labeling position saves the corresponding relationship of target the mark object and the target labeling position.I.e. the present invention can pass through
Drag operation realizes the dragging to target mark object, so that it is determined that the target labeling position of the target mark object after pulling, is realized
The dynamic label placement of to map, improves the convenience of mark.
Another embodiment of the present invention discloses a kind of map label method, as shown in Fig. 2, method includes the following steps:
Step 201: when receiving the drag operation for the target mark object on map, forbidding itself of the map
Drag function;
Step 202: at the end of the drag operation, obtaining outside the target mark object and the predetermined map
Base position between the first offset;
Base position is used to calculate the offset between the first position on target mark object and map, which is
A position outside map, can be preset, or specified by user by system.
It optionally, can be using the upper right Angle Position of the Webpage where map as base position, alternatively, can be by ground
The upper left position of Webpage where scheming is as a reference value, and the present invention is not limited thereto certainly;For example, if current aobvious
Show interface while showing map and another display object, it is possible to using a certain position of another display object as base
Level is set.
Step 203: obtaining the second offset between the first position and the base position on the predetermined map
Amount;
First position on the map can also be set based on actual conditions, for example, can be by the upper left on map
Angle Position is perhaps made using the lower right position on map as first position or by map center location as first position
For first position.
Step 204: the target mark object and described the are calculated based on first offset and second offset
Third offset between one position;
First offset and the second offset are made into difference and obtain the third offset between target mark object and first position.
Step 205: determining that the target of the target mark object on the map marks position using the third offset
It sets.
It should be noted that it is exactly picture of the target mark object on map that target, which marks target labeling position of the object on map,
Plain coordinate.And pixel coordinate of the target mark object on map is determined based on the base coordinate on map, i.e., target marks object
Offset with base coordinate position is pixel coordinate of the target mark object on map.Under normal circumstances, the base coordinate
Position be map on upper left position.It is preferred, therefore, that can be using the upper left position on map as the first of map
Position.
Therefore, determine that the target of the target mark object on the map marks position using the third offset
It sets, may include:
When determining the first position is the base coordinate position of map, directly using the third offset as described in
Target marks the target labeling position of object on the map;
When determining the first position not is the base coordinate position of map, the third offset is converted to described
Target marks the offset of object and the base coordinate position, then exists the offset after conversion as target mark object
Target labeling position on the map.
It certainly, in the present invention, can also be using the upper right Angle Position on map as the position of basic coordinate.
In order to make it easy to understand, being illustrated with a simple examples, as shown in Figure 3a, it is assumed that base position is net where map
The upper left position A of page S1, first position are the upper left position B on map S2, and target marks level in the position on map S2
Set C.
So, the first offset between target mark object position C and base position A is (a1, b1), first position B
The second offset between the A of base position is (a2, b2), to mark object position C and the by calculating target as difference
Third offset between one position B is ((a1-a2), (b1-b2)).In this example, based on the upper left position B on map
Coordinate position, therefore, third offset are ((a1-a2), (b1-b2)), and the pixel coordinate on map of object is marked for target,
As target labeling position of the target mark object on map.
As shown in Figure 3b, as the center D on the map that first position is map S2, then, target marks where object
The first offset between position C and base position A is (a1, b1), and the second offset between first position D and base position A is
(a3, b3), thus by making difference to calculate target to mark the third offset between object position C and first position D to be ((a3-
A1), (b3-b1)).
In this example, the upper left position B on map is basic coordinate position, then, need by third offset into
Row conversion, is converted into the offset of target mark object position C and the upper left position B on map.Specifically, determining
The offset between upper left position B on center D and map, the present embodiment are referred to as the 5th offset, the 5th offset
Amount is (a4, b4), then obtaining the offset for the upper left position B that target marks on object position C and map by making difference
For ((a4- (a3-a1)), (b4- (b3-b1))), the offset after converting marks pixel coordinate of the object on map into target, i.e.,
Target labeling position of the object on map is marked for target.
It should be noted that the offset between two positions include two positions offset in the horizontal direction and
Offset on vertical direction.
It can be seen that the present embodiment can realize the dragging for marking object to target by drag operation, so that it is determined that pulling
The target labeling position of target mark object afterwards, realizes the dynamic label placement of to map, improves the convenience of mark.
In the present invention, the operation such as amplify, reduce, moving for the ease of user's to map, when dragging for map
After dragging operation, it can be again started up itself drag function of map, and after starting itself drag function of map, map
State can cause to change by the operation such as pulling, zooming in or out.When the state of map changes, target will lead to
Pixel coordinate of the object on map is marked to change, therefore, it is necessary to redefine the target labeling position of target mark object, this
It invents another embodiment and discloses a kind of map label method, to realize the target labeling position after map state changes
Redefine.
As shown in figure 4, method includes the following steps:
Step 401: when receiving the drag operation for the target mark object on map, forbidding itself of the map
Drag function;
Step 402: at the end of the drag operation, starting itself drag function of the map;
In order to not influence the dragging behavior for being directed to map itself, in the present invention, when for the dragging behaviour of target mark object
At the end of work, start itself drag function of map, it is possible to the dragging for map itself be realized, for the sheet of map
The drag operation of body includes at least amplifying operation, reduction operation, moving operation.
Step 403: obtain between the base position outside target mark object and the predetermined map first partially
Shifting amount;
Step 404: obtaining the second offset between the first position and the base position on the predetermined map
Amount;
First position on the map can also be set based on actual conditions, for example, can be by the upper left on map
Angle Position is perhaps made using the lower right position on map as first position or by map center location as first position
For first position.
Step 405: the target mark object and described the are calculated based on first offset and second offset
Third offset between one position;
First offset and the second offset are made into difference and obtain the third offset between target mark object and first position.
Step 406: after starting itself drag function of the map, when the state for determining the map changes
When, the third offset is converted to the geographical position coordinates of the target mark object;
The geographical position coordinates are the practical latitude and longitude coordinates that target marks object.The practical longitude and latitude of element on map is sat
Mark is to be calculated based on the preset base coordinate on map, and under normal circumstances, the position of the base coordinate is ground
Upper left position on figure.It is preferred, therefore, that can be using the upper left position on map as the first position of map.
Correspondingly, the third offset to be converted to the geographical position coordinates of the target mark object, comprising:
When determining the first position is the base coordinate position of map, the third offset is directly converted into institute
State the geographical position coordinates of target mark object;
When determining the first position not is the base coordinate position of map, the third offset is converted to described
Target marks the offset of object and the base coordinate position, then the offset is converted to the ground of the target mark object
Manage position coordinates.
The conversion regime can be calculated based on coordinates transformation method, and which is existing calculation, the present invention
Excessive explanation is not done.It should be noted that needing to calculate the geographical position of target mark object when the state of first time map changes
Set coordinate, and when the state of map later changes again, then be used directly the geographical position coordinates, without each
All recalculate.
In the present embodiment, after starting itself drag function of the map, first determine that the state of the map changes
Become, then the third offset is converted to the geographical position coordinates of the target mark object.And in another embodiment of the present invention
In, the third offset first can be converted to the geographical position coordinates of the target mark object, and stored, work as determination
When the state of the map changes, the geographical position coordinates are directly utilized.
Step 406: the geographical position coordinates being inverted to coordinate system locating for the map, obtain the target mark
Coordinate position of the object on the map after state changes, using the coordinate position as target mark object in institute
State the target labeling position on map;
After starting itself drag function of map, the current state of map may change, when the current shape of map
When state changes, it will lead to pixel coordinate of the identified target mark object on map and change, it is therefore desirable to again
Determine coordinate position of the target mark object on the map after state changes.Due to the geographical position coordinates of target mark object
It is the accurate location of target mark object, therefore coordinate system locating for map can be inverted to based on geographical position coordinates, obtains mesh
Mark coordinate position of the labeling position on the map after state changes.
In the present embodiment, the coordinate position obtained after reversion is target mark position of the target mark object on map
It sets, if determining the target labeling position of the target mark object on the map using third offset before, that
, the replacement of the two need to be only carried out, that is, the coordinate position redefined is utilized to replace predetermined target labeling position.
It should be noted that the third offset for target to be marked object and first position is converted to geographical position coordinates
Coordinates transformation method and the coordinate for the 4th offset that geographical position coordinates are reversed to target mark object and first position are converted
Algorithm is just opposite algorithm.
Based on example above, as shown in fig. 5, it is assumed that target labeling position becomes from C1 point after the state of map changes
For C2 point, then, it is that target marks object and exists by the 4th offset (a5, b5) after the geographical position coordinates conversion of target mark object
Pixel coordinate on map S2, as target labeling position.
Step 407: saving the corresponding relationship of target the mark object and the target labeling position.
It can be seen that the present embodiment can realize the dragging for marking object to target by drag operation, so that it is determined that pulling
The target labeling position of target mark object afterwards, realizes the dynamic label placement of to map, improves the convenience of mark.
It is corresponding with a kind of above-mentioned map label method, the invention also discloses a kind of map label device, below by way of
Several embodiments are described in detail.
One embodiment of the invention discloses a kind of map label device, as shown in fig. 6, the device includes: the first reception
Unit 601 determines position units 602 and save location unit 603;Wherein:
First receiving unit 601, for forbidding institute when receiving the drag operation for the target mark object on map
State itself drag function of map;
In the present invention, drag function can be added for the element on map in advance, so that in triggering for map
It, can be by the way that irremovable element, these elements can be referred to as to mark originally on drag operation moving map when mark behavior
Infuse object.That is, mark object is the element for being attached with drag function on map.Optionally, device further include: additional function list
Member determines that the element with the drag function is for being that the element on map adds drag function using DOM operating method
Mark object.The DOM operating method includes the operating method of Jquery UI operating method or javascript DOM.
The drag operation can operate to touch drag operation or mouse drag.
First receiving unit can be used for determining the dragging of drag operation when determining that the mark behavior for map starts
Object is that target marks object, and forbids itself drag function of map.Wherein, triggering has for the mode of the mark behavior of map
It is a variety of, for example, can click map on a certain specific keys by way of trigger or to map on a certain element into
It is triggered when row predetermined operation, the time for such as clicking a certain element reaches preset time, determine that triggering is directed to the mark behavior of map,
And determine that the element is that target marks object.
It should be noted that the current display area that itself drag function of map is map can be based on drag operation
The function of change, and itself drag function of map can not change the geographical position coordinates of the element on map.
Position units 602 are determined, at the end of the drag operation, determining the target mark object in the map
On target labeling position;
Wherein it is determined that position units can be used for determining when detecting drag operation of the release for target mark object
Drag operation terminates, and target mark object position is target mark of the target mark object on map at the end of drag operation
Position.For example, user carries out drag operation to target mark object, target mark object is dragged to ground by the first position on map
It is discharged behind the second position on figure, determines that drag operation terminates, which is that target marks target mark of the object on map
Infuse position.
Optionally, target labeling position can be manually entered by user;Certainly, system can also calculate target mark automatically
Position can specifically be discussed in detail later.
Save location unit 603, for saving the corresponding relationship of target the mark object and the target labeling position.
In another embodiment of the present invention, a kind of map label device further include: the first transmission unit, and/or, first updates
Unit.
Wherein, the first transmission unit is used to send the corresponding relationship of target mark object and the target labeling position
To server.
First updating unit, for by the target mark object and the target labeling position corresponding relationship be updated to
In the data of the outer elements correlation of the map.
It can be seen that in the present embodiment, when receiving the drag operation for the target mark object on map, forbidding
Itself drag function of map determines the target of the target mark object on the map at the end of the drag operation
Labeling position saves the corresponding relationship of target the mark object and the target labeling position.I.e. the present invention can pass through dragging
The dragging to target mark object is realized in operation, so that it is determined that the target labeling position of the target mark object after pulling, realizes pair
The dynamic label placement of map improves the convenience of mark.
Another embodiment of the present invention discloses a kind of map label device, in the present embodiment, as shown in fig. 7, determining position
Setting unit includes: the first acquisition module 7021, and second obtains module 7022, the first computing module 7023 and the first determining module
7024;Wherein:
First obtains module 7021, at the end of the drag operation, obtaining the target mark object and in advance really
The first offset between base position outside the fixed map;
Base position is the benchmark for calculating the offset between the first position on target mark object and map, the base
Level is set to the position outside map, can be preset by system, or specified by user.It optionally, can will explicitly
The upper right Angle Position of the Webpage of figure is as base position, alternatively, the upper left corner position of the Webpage of map can will be shown
It sets as a reference value, the present invention is not limited thereto certainly;For example, if current display interface shows map and another simultaneously
One display object, it is possible to using a certain position of another display object as base position.
Second obtains module 7022, for obtaining the first position on the predetermined map and the base position
Between the second offset;
First position on the map can also be set based on actual conditions, for example, can be by the upper left on map
Angle Position is perhaps made using the lower right position on map as first position or by map center location as first position
For first position.
First computing module 7023, for calculating the target mark based on first offset and second offset
Infuse the third offset between object and the first position;
First offset and the second offset are made into difference and obtain the third offset of target mark object and first position.
First determining module 7024, for determining the target mark object on the map using the third offset
Target labeling position.
It should be noted that it is exactly picture of the target mark object on map that target, which marks target labeling position of the object on map,
Plain coordinate.And pixel coordinate of the target mark object on map is determined based on the base coordinate on map, i.e., target marks object
Coordinate with the offset of base coordinate position is pixel coordinate of the target mark object on map.Under normal circumstances, the base
The position of plinth coordinate is the upper left position on map.It is preferred, therefore, that can be using the upper left position on map as map
First position.
Therefore, the first determining module specifically can be used for when the base coordinate position that the determining first position is map
When, the target labeling position of object on the map directly is marked using the third offset as the target, when determining
When to state first position not be the base coordinate position of map, by the third offset be converted to the target mark object with it is described
Then the offset of base coordinate position marks the target of object on the map for the offset after conversion as the target
Labeling position.
It can be seen that the present embodiment can realize the dragging for marking object to target by drag operation, so that it is determined that pulling
The target labeling position of target mark object afterwards, realizes the dynamic label placement of to map, improves the convenience of mark.
In the present invention, the operation such as amplify, reduce, moving for the ease of user's to map, when dragging for map
After dragging operation, it can be again started up itself drag function of map, and after starting itself drag function of map, map
State can cause to change by the operation such as pulling, zooming in or out.When the state of map changes, target will lead to
It marks pixel coordinate of the object on map to change, therefore, it is necessary to redefine the target labeling position of target mark object, base
In the problem, further embodiment of this invention discloses a kind of map label device, and on the basis of the above embodiments, the device is also
Include:
Startup function unit, for starting itself drag function of the map when the drag operation result;
Status determining unit, for after starting itself drag function of the map, the state for detecting the map to be
It is no to change;
Correspondingly, determining position units further include: the first conversion module and the first reversal block.Wherein:
First conversion module, for when the state of the map changes, the third offset to be converted to institute
State the geographical position coordinates of target mark object;
Wherein, the geographical position coordinates are the practical latitude and longitude coordinates that target marks object.The reality of element on map
Latitude and longitude coordinates be to be calculated based on the preset base coordinate on map, under normal circumstances, the base coordinate
Position is the upper left position on map.It is preferred, therefore, that can be using the upper left position on map as first of map
It sets.
That is, the first conversion module specifically can be used for when the base coordinate position that the determining first position is map
When setting, the third offset is directly converted to the geographical position coordinates of the target mark object;When determining described first
It sets when not being the base coordinate position of map, the third offset is first converted into the target mark object and the basis is sat
Then the offset is converted to the geographical position coordinates of the target mark object by the offset of cursor position.
The conversion regime can be calculated based on coordinates transformation method, and which is existing calculation, the present invention
Excessive explanation is not done.It should be noted that needing to calculate the geographical position of target mark object when the state of first time map changes
Set coordinate, and when the state of map later changes again, then be used directly the geographical position coordinates, without each
All recalculate.
First reversal block obtains institute for the geographical position coordinates to be inverted to coordinate system locating for the map
Coordinate position of the target mark object on the map after state changes is stated, using the coordinate position as the target
Mark the target labeling position of object on the map.
After starting itself drag function of map, the current state of map may change, when the current shape of map
When state changes, it will lead to pixel coordinate of the identified target mark object on map and change, it is therefore desirable to again
Determine coordinate position of the target mark object on the map after state changes.Due to the geographical position coordinates of target mark object
It is the accurate location of target mark object, therefore coordinate system locating for map can be inverted to based on geographical position coordinates, obtains mesh
Mark coordinate position of the labeling position on the map after state changes.
In the present embodiment, the coordinate position obtained after reversion is target mark position of the target mark object on map
It sets, if determining the target labeling position of the target mark object on the map using third offset before, that
, the replacement of the two need to be only carried out, that is, the coordinate position redefined is utilized to replace predetermined target labeling position.
It should be understood that the third offset for target to be marked object and first position is converted to geographical position coordinates
The coordinate of coordinates transformation method and the 4th pixel coordinate that geographical position coordinates are reversed to target mark object and first position turns
Scaling method is just opposite algorithm.
It can be seen that the present embodiment can realize the dragging for marking object to target by drag operation, so that it is determined that pulling
The target labeling position of target mark object afterwards, realizes the dynamic label placement of to map, improves the convenience of mark.
A kind of map label device includes processor and memory, above-mentioned first receiving unit, determine position units,
Save location unit and the first start unit etc. store in memory as program unit, are stored in by processor execution
Above procedure unit in reservoir realizes corresponding function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one
Or more, the dynamic label placement of to map is realized by adjusting kernel parameter, improves the convenience of mark.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, if read-only memory (ROM) or flash memory (flash RAM), memory include that at least one is deposited
Store up chip.
The embodiment of the invention provides a kind of storage mediums, are stored thereon with program, real when which is executed by processor
A kind of existing map label method.Optionally, equipment executes such as where controlling the storage medium when described program is run
Upper a kind of described in any item map label methods.
The embodiment of the invention provides a kind of processor, the processor is for running program, wherein described program operation
A kind of map label method described in Shi Zhihang.
The embodiment of the invention provides a kind of equipment, equipment include processor, memory and storage on a memory and can
The program run on a processor, processor perform the steps of when executing program
When receiving the drag operation for the target mark object on map, that forbids the map itself pulls function
Energy;
At the end of the drag operation, the target labeling position of the target mark object on the map is determined;
Save the corresponding relationship of target the mark object and the target labeling position.
Preferably, before receiving the drag operation for the target mark object on map, when processor executes program
Also perform the steps of
Using the additional drag function of element that DOM DOM Document Object Model operating method is on the map, determining has institute
The element of drag function is stated as mark object.
Preferably, the target labeling position of the determination target mark object on the map, comprising:
Obtain the first offset between the base position outside the target mark object and the predetermined map;
Obtain the second offset between the first position and the base position on the predetermined map;
It is calculated between the target mark object and the first position based on first offset and second offset
Third offset;
The target labeling position of the target mark object on the map is determined using the third offset.
Preferably, at the end of the drag operation, processor also performs the steps of when executing program
Start itself drag function of the map;And
After starting itself drag function of the map, if the state of the map changes, the determining institute
State the target labeling position of target mark object on the map, further includes:
The third offset is converted to the geographical position coordinates of the target mark object;Wherein, the geographical location
Coordinate is the practical latitude and longitude coordinates that target marks object;
The geographical position coordinates are inverted to coordinate system locating for the map, obtain the target mark object in state
The coordinate position on the map after changing, on the map using the coordinate position as target mark object
Target labeling position.
Preferably, it is also performed the steps of when processor executes program
The corresponding relationship of target mark object and the target labeling position is sent to server;
And/or by the target mark object and the target labeling position corresponding relationship be updated to outside the map
In the data of elements correlation.
Equipment herein can be server, PC, PAD, mobile phone etc..
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just
The program of beginningization there are as below methods step:
When receiving the drag operation for the target mark object on map, that forbids the map itself pulls function
Energy;
At the end of the drag operation, the target labeling position of the target mark object on the map is determined;
Save the corresponding relationship of target the mark object and the target labeling position.
It preferably, can also be by the following method before receiving the drag operation for the target mark object on map
The program of step:
Using the additional drag function of element that DOM DOM Document Object Model operating method is on the map, determining has institute
The element of drag function is stated as mark object.
Preferably, the target labeling position of the determination target mark object on the map, comprising:
Obtain the first offset between the base position outside the target mark object and the predetermined map;
Obtain the second offset between the first position and the base position on the predetermined map;
It is calculated between the target mark object and the first position based on first offset and second offset
Third offset;
The target labeling position of the target mark object on the map is determined using the third offset.
Preferably, at the end of the drag operation, can also step by the following method program:
Start itself drag function of the map;And
After starting itself drag function of the map, if the state of the map changes, the determining institute
State the target labeling position of target mark object on the map, further includes:
The third offset is converted to the geographical position coordinates of the target mark object;Wherein, the geographical location
Coordinate is the practical latitude and longitude coordinates that target marks object;
The geographical position coordinates are inverted to coordinate system locating for the map, obtain the target mark object in state
The coordinate position on the map after changing, on the map using the coordinate position as target mark object
Target labeling position.
Preferably, can also step by the following method program:
The corresponding relationship of target mark object and the target labeling position is sent to server;
And/or by the target mark object and the target labeling position corresponding relationship be updated to outside the map
In the data of elements correlation.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element
There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art,
Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement,
Improve etc., it should be included within the scope of the claims of this application.
Claims (10)
1. a kind of map label method, which is characterized in that this method comprises:
When receiving the drag operation for the target mark object on map, forbid itself drag function of the map;
At the end of the drag operation, the target labeling position of the target mark object on the map is determined;
Save the corresponding relationship of target the mark object and the target labeling position.
2. the method according to claim 1, wherein receiving the dragging for the target mark object on map
Before operation, further includes:
Using the additional drag function of element that DOM DOM Document Object Model operating method is on the map, determining has described drag
The element of function is dragged as mark object.
3. method according to claim 1 or 2, which is characterized in that the determination target mark object is in the map
On target labeling position, comprising:
Obtain the first offset between the base position outside the target mark object and the predetermined map;
Obtain the second offset between the first position and the base position on the predetermined map;
The between target mark object and the first position is calculated based on first offset and second offset
Three offsets;
The target labeling position of the target mark object on the map is determined using the third offset.
4. according to the method described in claim 3, it is characterized in that, at the end of the drag operation, this method further include:
Start itself drag function of the map;And
After starting itself drag function of the map, if the state of the map changes, the determination mesh
The target labeling position of mark mark object on the map, further includes:
The third offset is converted to the geographical position coordinates of the target mark object;Wherein, the geographical position coordinates
The practical latitude and longitude coordinates of object are marked for target;
The geographical position coordinates are inverted to coordinate system locating for the map, the target mark object is obtained and occurs in state
The coordinate position on the map after change, the mesh using the coordinate position as target mark object on the map
Mark labeling position.
5. the method according to claim 1, wherein further include:
The corresponding relationship of target mark object and the target labeling position is sent to server;
And/or the corresponding relationship of target mark object and the target labeling position is updated to and element outside the map
In associated data.
6. a kind of map label device, which is characterized in that the device includes:
First receiving unit, for forbidding the map when receiving the drag operation for the target mark object on map
Itself drag function;
Position units are determined, at the end of the drag operation, determining the mesh of the target mark object on the map
Mark labeling position;
Save location unit, for saving the corresponding relationship of target the mark object and the target labeling position.
7. device according to claim 6, which is characterized in that the determining position units, comprising:
First obtains module, at the end of the drag operation, obtain the target mark object with it is predetermined described
The first offset between base position outside map;
Second obtains module, for obtaining second between first position and the base position on the predetermined map
Offset;
First computing module, for calculating the target mark object and institute based on first offset and second offset
State the third offset between first position;
First determining module, for determining the target mark of the target mark object on the map using the third offset
Infuse position.
8. according to device described in right 7, which is characterized in that the device further include:
Startup function unit, for starting itself drag function of the map at the end of the drag operation;
Status determining unit, for after starting itself drag function of the map, whether the state for detecting the map to be sent out
It is raw to change;
Correspondingly, the determining position units further include:
First conversion module, for when the state of the map changes, the third offset to be converted to the mesh
The geographical position coordinates of mark mark object;
First reversal block obtains the mesh for the geographical position coordinates to be inverted to coordinate system locating for the map
Coordinate position of the mark mark object on the map after state changes, marks the coordinate position as the target
The target labeling position of object on the map.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When control the storage medium where equipment execute a kind of map label method according to any one of claims 1 to 5.
10. a kind of processor, which is characterized in that the processor executes such as right for running program when described program is run
It is required that a kind of map label method described in any one of 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710826599.8A CN109508134A (en) | 2017-09-14 | 2017-09-14 | A kind of map label method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710826599.8A CN109508134A (en) | 2017-09-14 | 2017-09-14 | A kind of map label method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109508134A true CN109508134A (en) | 2019-03-22 |
Family
ID=65744443
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710826599.8A Pending CN109508134A (en) | 2017-09-14 | 2017-09-14 | A kind of map label method and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109508134A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110750613A (en) * | 2019-10-28 | 2020-02-04 | 高晓雷 | Map marking method for marking position and positioning in all-digital form by taking city as center |
CN112464307A (en) * | 2020-10-16 | 2021-03-09 | 北京居理科技有限公司 | Paper map derivation method of house finding tool |
CN112863318A (en) * | 2021-02-04 | 2021-05-28 | 北京高因科技有限公司 | Dragging and connecting method in paper map, electronic equipment and storage medium |
CN114969236A (en) * | 2022-07-25 | 2022-08-30 | 倍智智能数据运营有限公司 | Method for realizing user-defined map annotation based on React |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100146436A1 (en) * | 2008-02-01 | 2010-06-10 | Gabriel Jakobson | Displaying content associated with electronic mapping systems |
CN101995256A (en) * | 2009-08-11 | 2011-03-30 | 宏达国际电子股份有限公司 | Route planning method and device and computer program product used thereby |
CN102467519A (en) * | 2010-11-04 | 2012-05-23 | 中国电信股份有限公司 | Visualization plotting method and system based on geographic information system |
CN104679423A (en) * | 2013-12-03 | 2015-06-03 | 方正国际软件(北京)有限公司 | Method and system for accurately positioning geographic position of touch screen |
-
2017
- 2017-09-14 CN CN201710826599.8A patent/CN109508134A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100146436A1 (en) * | 2008-02-01 | 2010-06-10 | Gabriel Jakobson | Displaying content associated with electronic mapping systems |
CN101995256A (en) * | 2009-08-11 | 2011-03-30 | 宏达国际电子股份有限公司 | Route planning method and device and computer program product used thereby |
CN102467519A (en) * | 2010-11-04 | 2012-05-23 | 中国电信股份有限公司 | Visualization plotting method and system based on geographic information system |
CN104679423A (en) * | 2013-12-03 | 2015-06-03 | 方正国际软件(北京)有限公司 | Method and system for accurately positioning geographic position of touch screen |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110750613A (en) * | 2019-10-28 | 2020-02-04 | 高晓雷 | Map marking method for marking position and positioning in all-digital form by taking city as center |
CN110750613B (en) * | 2019-10-28 | 2021-05-04 | 高晓雷 | Map marking method for marking position and positioning in all-digital form by taking city as center |
CN112464307A (en) * | 2020-10-16 | 2021-03-09 | 北京居理科技有限公司 | Paper map derivation method of house finding tool |
CN112863318A (en) * | 2021-02-04 | 2021-05-28 | 北京高因科技有限公司 | Dragging and connecting method in paper map, electronic equipment and storage medium |
CN114969236A (en) * | 2022-07-25 | 2022-08-30 | 倍智智能数据运营有限公司 | Method for realizing user-defined map annotation based on React |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109508134A (en) | A kind of map label method and apparatus | |
CN110362242B (en) | Map display method and terminal equipment | |
CN103946837A (en) | Managing map elements using aggregate feature identifiers | |
CN110717005B (en) | Thermodynamic diagram texture generation method, device and equipment | |
CN103270509A (en) | Methods, apparatuses and computer program products for converting a geographical database into a map tile database | |
CN104850641A (en) | Information recommendation method and device | |
US10867251B2 (en) | Estimation results display system, estimation results display method, and estimation results display program | |
CN109683773A (en) | Corpus labeling method and device | |
US20190147032A1 (en) | Data flow view for a spreadsheet | |
CN107977342B (en) | Document comparison method and device | |
CN106776612B (en) | Display method and device of geographical thermodynamic diagram | |
CN104991727A (en) | Information display method and device | |
CN109857964B (en) | Thermodynamic diagram drawing method and device for page operation, storage medium and processor | |
CN110308835A (en) | Control the method, apparatus and electronic equipment of view control | |
CN108320174A (en) | Information-pushing method and device | |
CN102855132A (en) | Method and system for selection of graphic objects | |
Schwartges et al. | Point labeling with sliding labels in interactive maps | |
KR20140062647A (en) | Method and apparatus for producing space map of indoor | |
CN110069488A (en) | A kind of date storage method, method for reading data and its device | |
CN109582188B (en) | Method, device and related equipment for realizing element positioning in popup window | |
CN109101144B (en) | Thermodynamic diagram drawing method and device | |
CN101694707A (en) | Method and device for budget control | |
CN109683887A (en) | A kind of construction method and device for supporting the customized web project of multi-scheme | |
CN102968805A (en) | Picture superposition method and system | |
US20140285526A1 (en) | Apparatus and method for managing level of detail contents |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 100080 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190322 |