Embodiment
Embodiments provide a kind of method and device of map smoothly movement, for the display of map in navigational system, make map can smoothly movement.
Refer to Fig. 1, be the embodiment of the method for a kind of map smoothly movement of the embodiment of the present invention, comprise:
101, Real-time Obtaining current display interface needs the scope of the map drawn;
Be moved in process at map, system real-time acquisition current display interface will need the scope of the map drawn.
102, judge to need the scope of the map drawn whether in preset reference bitmap, if so, then perform step 103, if not, then execution step 104;
In embodiments of the present invention, system, by Pre-set reference bitmap, is the map drawn existed with bitmap form with reference to bitmap, and is buffered in system with reference to bitmap, do not need the drafting to the loading and map carrying out data in use.
After system obtains the scope needing the map drawn, will judge that the scope of the map that the needs that get are drawn is whether in preset reference bitmap.
103, the map needing to draw is being presented in current display interface with reference to the corresponding part in bitmap;
When the scope needing the map drawn completely with reference in bitmap time, then can need from reference to obtaining current display interface buffer area corresponding to bitmap the part that the map of display is corresponding, and the part got is presented in current display interface.
104, judge whether data corresponding to map needing to draw are buffered in data buffer area, when data buffer storage corresponding to the map needing to draw is in data buffer area, perform step 105;
When needing the scope of the map drawn not in reference bitmap, system is in order to determine whether data corresponding for the map judging further to need to draw are buffered in data buffer area by the mode obtained for the data of map making.
105, from data buffer area, obtain the data needing the map of drafting corresponding;
In embodiments of the present invention, buffer memory used data in data buffer area, be specially, the data that the map not in reference bitmap shown on display interface is corresponding, by utilizing the used data of data buffer area buffer memory, to the loading of data before can mapping being avoided.
106, in current display interface, corresponding map is shown according to the data got.
System gets not after the data that the map drawn with reference to the needs in bitmap is corresponding, by the map corresponding according to the Plotting data current display interface got, and by the map denotation of drafting in current display interface.
By using the reference bitmap drawn of buffer memory, make when the map needing to draw is in reference bitmap, can directly be presented at current display interface in figure with reference to part corresponding in bitmap by what need to draw, do not need loading and the drafting of carrying out map datum, effectively can shorten the time of map denotation, make the movement that map can be level and smooth.Meanwhile, when the map needing to draw is not in reference bitmap, by utilizing the Plotting data map of buffer memory in data buffer area effectively can avoid Data import, shortens the time of map denotation, realizing the level and smooth movement of map.
In order to better understand technology, referring to Fig. 2, being the embodiment of the method for a kind of map smoothly movement of the embodiment of the present invention, comprising:
201, Real-time Obtaining current display interface needs the scope of the map drawn;
User is when using navigational system, map will be dragged as required, map is moved, or the display interface of navigational system is by the moving direction according to guider, the map that real-time change current display interface shows, such as, in auto-navigation system, display interface is by the map on renewal display interface real-time for the position residing for user, and therefore system is by the real-time drafting carrying out map.
In embodiments of the present invention, map is in the process of movement, and system real-time acquisition current display interface will need the scope of the map drawn.
202, judge to need the scope of the map drawn whether in preset reference bitmap, if so, then perform step 203, if not, then execution step 204;
User is when using navigational system, time most, the scope of map change is not too large, therefore system install beforehand is with reference to bitmap carry out buffer memory with reference to bitmap, wherein, the area with reference to bitmap is at least 2 times of the screen area of current display interface, it should be noted that, in actual applications, user can select to arrange the size with reference to bitmap as required voluntarily, when user does not arrange the size with reference to bitmap, will use the size of the reference bitmap of system default.
In in the invention process, after system gets the scope needing the map drawn, by judging to need the scope of the map drawn whether in preset reference the bitmap, to determine the obtain manner of the map of needs drafting.
203, the map needing to draw is being presented in current display interface with reference to the corresponding part in bitmap;
With reference to the map drawn that bitmap is through buffer memory, when needing the map of drafting in reference bitmap, the part needing the map of drafting corresponding can be obtained from reference bitmap, part corresponding for the map of needs drafting is presented in current display interface.
204, judge to need data corresponding to the map of drafting whether to be buffered in data buffer area, if then perform step 205, if not, then perform step 206;
The content that step 104 shown in step 204 with Fig. 1 embodiment describes is identical, repeats no more herein.
205, from data buffer area, obtain the data corresponding to figure needing to draw;
The content that step 105 shown in step 205 with Fig. 1 embodiment describes is identical, repeats no more herein.
206, the data needing the map of drafting corresponding are loaded;
When the data that the map needing to draw is corresponding are not buffered in data buffer area, system will load the data needing the map of drafting corresponding.
207, resolve the data got and obtain corresponding fixed-length data and elongated data;
System by obtaining data corresponding to map needing to draw from data buffer area, or after loading data corresponding to the map that needs to draw, obtains corresponding fixed-length data and elongated data by resolving the data got.
In embodiments of the present invention, data buffer area adopts L2 cache mechanism, and in data buffer area the packet of buffer memory comprise shown not with reference to data corresponding to the map in bitmap, carry out buffer memory by data, make map not need all to load data in drawing process at every turn.Wherein, data are divided into fixed-length data and elongated data, and data before the use system cut, packet is made to contain fixed-length data and elongated data, fixed-length data refers to that the length of the structure that data use when utilizing Plotting data map is fixing, the extreme coordinates such as, comprised in section data, shape point coordinate and number can be described as fixed-length data, the size of the structure of fixed-length data is fixing, constant, elongated data refer to that the length of the structure that data use when utilizing Plotting data map can change, the road name such as, comprised in section data is elongated data, in packet, the form with pointer offset is associated by fixed-length data and elongated data, when usage data bag, after getting fixed-length data, corresponding elongated data can be got according to the side-play amount of pointer offset, by packet being cut into fixed-length data and elongated data, can make in the process of mapping, the gibberish used tails off, accelerate the speed of mapping.
It should be noted that, in embodiments of the present invention, fixed-length data can also comprise other data messages, the coordinate address of such as buildings, elongated data also can comprise other data message, the title of such as buildings, in embodiments of the present invention, the data message that fixed-length data in packet and variable-length packet contain, depending on concrete situation, does not limit herein.
208, according to resolving the Plotting data that obtains and showing map corresponding in current display interface.
System is carried out after parsing obtains fixed-length data and elongated data to the data got, by the map corresponding according to the Plotting data current display interface after resolving, and by the map denotation drawn in current display interface.
In embodiments of the present invention, before entering next display circle, data buffer storage corresponding for the map in current display interface not in reference bitmap in data buffer area, uses in order to later by system.
By using the reference bitmap drawn of buffer memory, make when the map needing to draw is in reference bitmap, can directly be presented at current display interface in figure with reference to part corresponding in bitmap by what need to draw, do not need loading and the drafting of carrying out map datum, effectively can shorten the time of map denotation, make the movement that map can be level and smooth.Simultaneously, when the map needing to draw is not in reference bitmap, effectively Data import can be avoided by utilizing the Plotting data map of buffer memory in data buffer area, and the packet of buffer memory is containing fixed-length data and elongated data, fixed-length data associates with the mode of elongated data pointer offset, effectively can shorten the time of map denotation, realize the level and smooth movement of map.
In embodiments of the present invention, embodiment shown in Fig. 1 and Fig. 2 describes the situation of map completely in reference bitmap and not in reference bitmap needing to draw, in actual applications, also may there is another kind of situation, namely need the map segment drawn in reference bitmap, and part is not with reference in bitmap, refers to Fig. 3, for another embodiment of the method for a kind of map smoothly movement of the embodiment of the present invention, comprising:
301, exceed region by needing the scope of the map drawn to be divided into and do not exceed region;
The embodiment of the present invention is to need the map segment drawn in reference bitmap, and part is not illustrating that map realizes the mode of level and smooth movement premised in bitmap.In this case, the scope of the map of required drafting is divided into and exceeds region and do not exceed region by system, wherein, exceed region refer to not with reference to bitmap scope within region, do not exceed region refer to reference to bitmap scope within region.System is by can processing by different processing modes needing the scope of the map drawn to carry out division.
302, judge that whether exceed data corresponding to region is buffered in data buffer area, if so, then performs step 303, if not, then perform step 304;
In data buffer area buffer memory shown not with reference to data corresponding to the map within the scope of bitmap, system obtain the map needing to draw exceed region after, will judge whether exceed data corresponding to region is buffered in data buffer area.
303, from data buffer area, exceed data corresponding to region described in acquisition, continue to perform step 306;
When exceed data corresponding to region in data buffer area time, corresponding data can be obtained from data buffer area, effectively avoid the loading of data.
304, loading exceeds data corresponding to region;
When exceed data corresponding to region not in data buffer area time, system by loading exceed packet corresponding to region.
305, exceed according to what get the map that Plotting data corresponding to region exceed region;
System exceeds data corresponding to region by obtaining from data buffer area, or after exceeding data corresponding to region by loading, map corresponding to region is exceeded by according to Plotting data corresponding to region that exceed got, in embodiments of the present invention, the packet obtained from data buffer area is containing fixed-length data and elongated data, before mapping, need to carry out parsing to data and obtain fixed-length data and elongated data, recycling fixed-length data and elongated data are carried out mapping and are obtained exceeding map corresponding to region.
306, will the map in region be exceeded and not exceed region and be presented in current display interface with reference to part corresponding in bitmap.
In embodiments of the present invention, do not exceed map corresponding to region to obtain from reference to bitmap, therefore, after system is drawn and exceeded map corresponding to region, by exceeding the map in region and not exceeding region being presented in current display interface with reference to part corresponding in bitmap, realize the display of map.
In embodiments of the present invention, by utilizing the display realizing map with reference to bitmap and data buffer area, and the packet in buffer area is containing fixed-length data and elongated data, makes the time shorten of map denotation, realizes the level and smooth movement of map.
Refer to Fig. 4, be the embodiment of the device of a kind of map smoothly movement of the embodiment of the present invention, comprise:
Acquiring unit 401, for being moved in process at map, Real-time Obtaining current display interface needs the scope of the map drawn;
First judging unit 402, whether need the scope of the map drawn in preset reference bitmap for judging, reference bitmap is the map drawn of buffer memory;
First display unit 403, for the scope of map of if desired drawing completely with reference in bitmap, then will need the map drawn being presented in current display interface with reference to the corresponding part in bitmap;
Second judging unit 404, for the scope of map of if desired drawing not with reference in bitmap, judge whether data corresponding to map needing to draw are buffered in data buffer area, data buffer area comprise shown not with reference to data corresponding to the map in bitmap;
Data capture unit 405, data buffer storage corresponding to the map for if desired drawing, in data buffer area, obtains the data corresponding to figure needing to draw from data buffer area;
Second display unit 406, for showing corresponding map in current display interface according to the data got.
In embodiments of the present invention, device also comprises:
Data import unit 407, the data that the map if desired drawn is corresponding are not buffered in data buffer area, reload the data needing the map of drafting corresponding.
In embodiments of the present invention, be moved in process at map, acquiring unit 401 Real-time Obtaining current display interface will need the scope of the map drawn, then whether the first judging unit 402 needs the scope of the map drawn in preset reference bitmap by judging, the scope of the map if desired drawn is completely in reference bitmap, and the map needing to draw is being presented in current display interface with reference to the corresponding part in bitmap by the first display unit 403, the scope of the map if desired drawn is not in reference bitmap, whether data corresponding for the map judging to need to draw are buffered in data buffer area by the second judging unit 404, data buffer storage corresponding to the map if desired drawn is in data buffer area, data capture unit 405 obtains the data corresponding to figure needing to draw from data buffer area, if desired the data that the map drawn is corresponding are not buffered in data buffer area, Data import unit 407 will load the data needing the map of drafting corresponding, after system gets data, second display unit 406 shows corresponding map by according to the data got in current display interface.
In embodiments of the present invention, device embodiment illustrated in fig. 4 is two kinds of situations of map in reference bitmap and not in reference bitmap for drawing when needs, in actual applications, also there is another kind of situation, namely need the map segment drawn in reference bitmap, refer to Fig. 5, be another device embodiment of a kind of map smoothly movement of the embodiment of the present invention, comprise:
Division unit 501, for working as a part for the scope needing the map drawn with reference in bitmap, is then divided into the scope of the map needing drafting and exceeds region and do not exceed region;
3rd judging unit 502, judges whether exceed data corresponding to region is buffered in data buffer area;
Acquiring unit 503, for when exceed data buffer storage corresponding to region in data buffer area time, then from data buffer area obtain exceed data corresponding to region;
Loading unit 504, for when exceeding data corresponding to region and not being buffered in data buffer area, then loads and exceeds data corresponding to region;
Drawing unit 505, for exceeding according to what get the map that Plotting data corresponding to region exceed region;
3rd display unit 506, for being presented at current display interface by the map and the described region that do not exceed that exceed region with reference to part corresponding in bitmap.
In embodiments of the present invention, when a part for the scope of the map of needs drafting is in reference bitmap, division unit 501 exceeds region by needing the scope of the map drawn to be divided into and does not exceed region, whether judgement is exceeded data corresponding to region and is buffered in data buffer area by the 3rd judging unit 502, when exceed data buffer storage corresponding to region in data buffer area time, acquiring unit 503 exceeds data corresponding to region by obtaining from data buffer area, when exceeding data corresponding to region and not being buffered in data buffer area, loading is exceeded data corresponding to region by loading unit 504, drawing unit 505 will exceed according to what get the map that Plotting data corresponding to region exceed region, finally, the map and the described region that do not exceed that exceed region are being presented in current display interface with reference to part corresponding in bitmap by the 3rd display unit 506.
By using the reference bitmap drawn of buffer memory, make when the map needing to draw is in reference bitmap, can directly be presented at current display interface in figure with reference to part corresponding in bitmap by what need to draw, do not need loading and the drafting of carrying out map datum, effectively can shorten the time of map denotation, make the movement that map can be level and smooth.Simultaneously, when the map needing to draw is not in reference bitmap, effectively Data import can be avoided by utilizing the Plotting data map of buffer memory in data buffer area, and the packet of buffer memory is containing fixed-length data and elongated data, fixed-length data associates with the mode of elongated data pointer offset, effectively can shorten the time of map denotation, realize the level and smooth movement of map.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
Above the method for a kind of map smoothly movement provided by the present invention and device are described in detail, for one of ordinary skill in the art, according to the thought of the embodiment of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.