Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated, for convenience of explanation, only show the part relevant with the embodiment of the invention.Should be appreciated that the specific embodiment that this place is described, only be used for explaining the present invention, not in order to limit the present invention.
Size and displacement that the present invention cuts figure and screen buffer according to the performance setting of mobile terminal device are divided into mobile terminal screen, screen buffer, painting canvas and cut figure, determine relative position; Calculating need be plotted in the first quantity N that cuts figure on the painting canvas, cuts figure by the attribute of cutting the figure correspondence with N and is presented at mobile terminal screen by painting canvas, screen buffer.
Embodiment one
Fig. 4 is the method overview flow chart that a kind of map of the embodiment of the invention shows.Described method may further comprise the steps:
S401, preset size and the displacement of Qie Tu and screen buffer, mobile terminal screen, screen buffer, painting canvas be divided into cut figure, the described figure of cutting has the rank of amplification, centre coordinate attribute, determines the relative position of mobile terminal screen, screen buffer, painting canvas;
The unit of the described figure of cutting, screen buffer, displacement is pixel, cut figure and comprise two attributes: level of zoom, centre coordinate, level of zoom is the defined attribute of electronic chart self, described centre coordinate refers to select the latitude and longitude coordinates in certain geographic position as the reference initial point, under certain level of zoom, according to cutting the figure size, electronic chart is divided into a plurality of figure of cutting, cutting figure is a kind of map picture that has centre coordinate (X, Y coordinate) and level of zoom;
The described figure of cutting and screen buffer are the sizes of cutting figure and screen buffer according to factor preset in advance such as the storage system of mobile terminal screen size, map system, background server program, buffer system, network delivery flow rates;
Described terminal screen, screen buffer, painting canvas are divided into the method for cutting figure is: calculate mobile terminal screen, screen buffer, painting canvas according to the size of cutting figure and be divided into the quantity of cutting figure, wherein the figure quantity of cutting of mobile terminal screen, screen buffer, painting canvas is by the length of mobile terminal screen, screen buffer, painting canvas or the width numerical value divided by the length of cutting figure or width gained, if institute's value non-integer then rounds and adds 1 again;
Described painting canvas covers on the screen buffer, the length of painting canvas and width can infinitely extend, painting canvas is the committed memory space not, only consume portable terminal and draw the time of cutting figure, be used for drawing the corresponding figure that cuts at the corresponding coordinate of painting canvas, if cut on the respective center coordinate that figure is plotted in painting canvas all, painting canvas has just constituted electronic chart so;
Described displacement is the each mobile distance of map, displacement that can be different to a plurality of direction settings;
Described relative position be mobile terminal screen in the superiors, painting canvas in the middle layer, screen buffer is at the bottom, when the UI event took place, mobile terminal screen and screen buffer invariant position had only painting canvas to make corresponding change;
For the ease of understanding, pixel with mobile terminal screen is that 240x320 is the example explanation, and according to the performance parameter of mobile terminal device, each is cut the pixel size of figure and sets 60x80, the pixel size of screen buffer is set at 360x480, and the figure quantity of cutting of painting canvas can be unrestricted; Upper and lower is when mobile, and displacement is set at 80 pixels, and when left and right direction moved, displacement was set at 60 pixels; Be as 11,12,13,22,23,24 as each grid among Fig. 2 and cut figure, wherein row 22,23,24,25 and row 22,32,42,52 to form S202 be mobile terminal screen, row 11,12,13,14,15,16 and row 11,21,31,41,51,61 to form S203 be screen buffer, S201 is painting canvas, and can infinitely extend;
S402, when receiving triggering command, calculating need be plotted in first quantity of cutting figure of described painting canvas, and the figure attribute of cutting of described first quantity and the described figure of cutting correspondence is deposited in first and cuts set of graphs;
Described triggering command refers to the UI event of operations such as input equipments such as button that the user uses mobile terminal device to be provided, touch-screen, inductor amplify, dwindle, move at map; According to the UI event that portable terminal triggers, painting canvas except do corresponding amplification, dwindle, the mobile step that also comprises:
S4021, painting canvas load and draw because of what the UI event need show and cut figure;
S4022, painting canvas cancellation is drawn because of the UI event does not need the figure that cuts that shows;
For the ease of understanding, pixel with mobile terminal screen is that 240x320 is the example explanation, if trigger the event that moves right, at this moment, painting canvas is moved to the left a displacement, also needs to comprise step simultaneously: painting canvas loads and draws the figure that cuts that cuts figure, painting canvas cancellation drafting left side one row displacement of right side one row displacement, as shown in Figure 3, wherein S301 is painting canvas, can infinitely extend; S302 is the original position of painting canvas; Position after the S303 painting canvas moves to left; S304 loads and draws a Lie Qietu who needs demonstration; The S305 mobile terminal screen is cut the invariant position of figure; The S306 screen buffer is cut the invariant position of figure; S307 or S308 painting canvas are moved to the left a length of cutting figure; S309 cancellation does not need the Lie Qietu that shows; Dwindling or amplify at electronic chart is exactly to draw this level of zoom sub-screen buffer zone scope inscribe figure at painting canvas again, repeats no more;
Described first cut set of graphs comprise need be plotted on the painting canvas cut that the figure first quantity N and each cut the figure correspondence cut the figure attribute;
First quantitative approach of cutting figure that described calculating need be plotted in described painting canvas is generally: according to the UI event, be moved or the convergent-divergent map after, determine that painting canvas and screen buffer overlapping region vacancy cut the figure total quantity; When landing map system first, first quantitative approach of cutting figure that calculating need be plotted in described painting canvas is: select the latitude and longitude coordinates of a geographic position A as the reference point, according to level of zoom and Qie Tu size, described map is divided into a plurality of figure of cutting; Need to show the map centered by the B of another one geographic position, then the mobile terminal screen central point be placed under the level of zoom B point correspondence and cut figure centre coordinate point, add up then mobile terminal screen included cut the figure number; The described figure of cutting number comprises that part is included in the figure that cuts in the mobile terminal screen;
S403, the attribute by the described figure of cutting is plotted to centre coordinate place corresponding in the painting canvas with described first figure that cuts that cuts in the set of graphs, painting canvas is plotted in screen buffer, and is presented at mobile terminal screen.
Size and displacement by presetting Qie Tu and screen buffer in the embodiment of the invention, mobile terminal screen, screen buffer, painting canvas is divided into cuts figure, the described figure of cutting has the amplification rank, the centre coordinate attribute, determine mobile terminal screen, screen buffer, the relative position of painting canvas, determine the direction that map moves by the UI trigger event, determine the quantity that the vacancy of needs demonstration is cut figure according to the displacement that presets, only painting canvas need be repainted the corresponding centre coordinate place of painting canvas with the figure that cuts of screen buffer overlapping region vacancy, be plotted to screen buffer from painting canvas, be shown to portable terminal again, improve drafting and show the efficient of cutting figure, improve the speed that I/O handles, solve screen and dodged screen, flower screen phenomenon improves the user and experiences; The vacancy of Hui Zhiing is cut figure and has been left this locality in if desired, does not then need remote download to cut figure, thereby reduces network access quantity.
Embodiment two
Fig. 5 is first particular flow sheet of a kind of map-indication method of the embodiment of the invention.Described method may further comprise the steps:
S501, preset size and the displacement of Qie Tu and screen buffer, mobile terminal screen, screen buffer, painting canvas be divided into cut figure, the described figure of cutting has the rank of amplification, centre coordinate attribute, determines the relative position of mobile terminal screen, screen buffer, painting canvas;
S502, when receiving triggering command, calculating need be plotted in the first quantity N that cuts figure of described painting canvas, and deposits the attribute of the described first quantity N and the described figure of cutting in first and cut set of graphs;
S503 cuts cutting figure and whether have this locality in the set of graphs by cutting figure determined property first; If execution in step S505 then; Execution in step S504 then if not;
S504, and obtain to remote server and not to be stored in local cutting figure and store this locality into;
S505 reads local cutting figure and be plotted to centre coordinate place corresponding in the described painting canvas;
S506 is plotted in screen buffer with painting canvas, and is presented at mobile terminal screen.
Size and displacement by presetting Qie Tu and screen buffer in the embodiment of the invention, mobile terminal screen, screen buffer, painting canvas is divided into cuts figure, the described figure of cutting has the amplification rank, the centre coordinate attribute, determine mobile terminal screen, screen buffer, the relative position of painting canvas, determine the direction that map moves by the UI trigger event, determine the quantity that the vacancy of needs demonstration is cut figure according to the displacement that presets, only painting canvas need be repainted the corresponding centre coordinate place of painting canvas with the figure that cuts of screen buffer overlapping region vacancy, be plotted to screen buffer from painting canvas, be shown to portable terminal again, improve drafting and show the efficient of cutting figure, improve the speed that I/O handles, solve screen and dodged screen, flower screen phenomenon improves the user and experiences; The vacancy of Hui Zhiing is cut figure and has been left this locality in if desired, does not then need remote download to cut figure, and have only the vacancy that needs to draw to cut figure and do not leave in and locally just arrive the remote server download, thus the minimizing network access quantity.
Embodiment three
Fig. 6 is second particular flow sheet of a kind of map-indication method of the embodiment of the invention.This embodiment calculates the first quantity N that cuts figure that need be plotted on the painting canvas and Qie Tu attribute and deposits first in and cut set of graphs, defines the first parameter n and second parametric t (n and t are integer); Judge that one by one first cuts cutting figure and whether have this locality in the set of graphs, if then read local cutting figure to internal memory and being plotted to the coordinate points of painting canvas correspondence of preserving; Judge whether n equals N, if, then painting canvas is plotted in screen buffer, be presented at mobile terminal screen.
Described method may further comprise the steps:
S601, preset size and the displacement of Qie Tu and screen buffer, mobile terminal screen, screen buffer, painting canvas be divided into cut figure, the described figure of cutting has the rank of amplification, centre coordinate attribute, determines the relative position of mobile terminal screen, screen buffer, painting canvas;
S602 starts network thread, and network thread is in dormant state, and the UI thread of operating system obtains the instruction of UI event and enters step S603;
S603, calculating need be plotted in the first quantity N that cuts figure of described painting canvas, and deposits the attribute of the described first quantity N and the described figure of cutting in first and cut set of graphs, presets the first parameter n and second parametric t, and n and t are positive integer, are initially 0;
S604 judges that one by one first cuts cutting figure and whether have this locality in the set of graphs, if not, then enters step S605, if then enter step S606;
The described figure that cuts that need draw refers to because the UI event is moved, amplifies, dwindles the figure that cuts that needs drafting, judges the local figure that cuts that whether has the needs drafting according to the attribute of cutting figure;
S605 deposits the local figure attribute of not preserving of cutting second in and cuts set of graphs, and second parametric t+1 enters step S607;
Described second cuts the local non-existent figure of the cutting quantity of set of graphs storage cuts the figure attribute with each;
S606 reads and local cut figure to internal memory and be plotted to the centre coordinate place of painting canvas correspondence;
S607, the first parameter n+1;
S608 judges whether n equals N, if, then enter step S609, if not, then enter step S604;
S609 is plotted in screen buffer with painting canvas, is presented at mobile terminal screen, wakes network thread up, and network thread enters step S610;
S610 judges whether t equals 0, if, then enter step S611, if not, then enter step S612;
S611, network thread enters dormant state;
S612 cuts set of graphs according to second and cuts figure and store this locality into from the remote server download, notice UI thread, and notice UI thread, the UI thread enters step S603, and network thread enters dormant state.
Finish by the cooperation of UI thread and network thread in the embodiment of the invention, figure and screen buffer size are cut in performance parameter setting according to mobile terminal device, mobile terminal screen, screen buffer, painting canvas is divided into cuts figure, determine relative position, wherein mobile terminal screen is in the superiors, painting canvas is in the middle layer, screen buffer is at the bottom, when receiving the UI event of triggering, mobile terminal screen and screen buffer invariant position have only painting canvas to make corresponding change, preferentially read the local figure that cuts, at first store the scratchpad area (SPA) into cutting figure, be plotted to painting canvas from the scratchpad area (SPA), be plotted to screen buffer from painting canvas, be shown to mobile terminal screen from screen buffer again, improve drafting and show the efficient of cutting figure, improve the speed that I/O handles, solved screen and dodged screen, flower screen phenomenon improves the user and experiences; The vacancy of Hui Zhiing is cut figure and has been left this locality in if desired, does not then need remote download to cut figure, and have only the vacancy that needs to draw to cut figure and do not leave in and locally just arrive the remote server download, thus the minimizing network access quantity.
Embodiment four
Fig. 7 is the overall construction drawing of a kind of map display system of the embodiment of the invention.
Described system comprises: initial installation, treating apparatus, display device;
Initial installation, be used for presetting size and the displacement of Qie Tu and screen buffer, mobile terminal screen, screen buffer, painting canvas be divided into cut figure, the described figure of cutting has the rank of amplification, centre coordinate attribute, determines the relative position of mobile terminal screen, screen buffer, painting canvas;
The unit of the described figure of cutting, screen buffer, displacement is pixel, cut figure and comprise two attributes: level of zoom, centre coordinate, level of zoom is the defined attribute of electronic chart self, wherein centre coordinate refers to select the latitude and longitude coordinates in certain geographic position as the reference initial point, under certain level of zoom, according to cutting the figure size, electronic chart is divided into a plurality of figure of cutting, cutting figure is a kind of map picture that has centre coordinate (X, Y coordinate) and level of zoom;
The described figure of cutting and screen buffer are the sizes of cutting figure and screen buffer according to factor preset in advance such as the storage system of mobile terminal screen size, map system, background server program, buffer system, network delivery flow rates;
Described terminal screen, screen buffer, painting canvas are divided into the method for cutting figure is: calculate mobile terminal screen, screen buffer, painting canvas according to the size of cutting figure and be divided into the quantity of cutting figure, wherein the figure quantity of cutting of mobile terminal screen, screen buffer, painting canvas is by the length of mobile terminal screen, screen buffer, painting canvas or the width numerical value divided by the length of cutting figure or width gained, if institute's value non-integer then rounds and adds 1 again;
Described painting canvas covers on the screen buffer, the length of painting canvas and width can infinitely extend, painting canvas is the committed memory space not, only consume portable terminal and draw the time of cutting figure, be used for drawing the corresponding figure that cuts at the corresponding coordinate of painting canvas, if all figure that cuts are plotted on the corresponding coordinate of painting canvas, painting canvas has just constituted electronic chart so;
Described displacement is the each mobile distance of map, displacement that can be different to a plurality of direction settings.
Described relative position be mobile terminal screen in the superiors, painting canvas in the middle layer, screen buffer is at the bottom, when the UI event took place, mobile terminal screen and screen buffer invariant position had only painting canvas to make corresponding change.
Treating apparatus, when being used for receiving triggering command, calculating need be plotted in first quantity of cutting figure of described painting canvas, and deposits the attribute of the described first quantity N and the described figure of cutting in first and cut set of graphs;
Described triggering command refers to the UI event of operations such as input equipments such as button that the user uses mobile terminal device to be provided, touch-screen, inductor amplify, dwindle, move at map; According to the UI event that portable terminal triggers, painting canvas except do corresponding amplification, dwindle, the mobile step that also comprises:
Painting canvas loads and draws because of what the UI event need show cuts figure;
Painting canvas cancellation is drawn because of the UI event does not need the figure that cuts that shows;
Described first cut set of graphs comprise need be plotted on the painting canvas cut that the figure first quantity N and each cut the figure correspondence cut the figure attribute;
First quantitative approach of cutting figure that described calculating need be plotted in described painting canvas is generally: according to the UI event, be moved or the convergent-divergent map after, determine that painting canvas and screen buffer overlapping region vacancy cut the figure total quantity; When landing map system first, first quantitative approach of cutting figure that calculating need be plotted in described painting canvas is: select the latitude and longitude coordinates of a geographic position A as the reference point, according to level of zoom and Qie Tu size, described map is divided into a plurality of figure of cutting; Need to show the map centered by the B of another one geographic position, then the mobile terminal screen central point be placed under the level of zoom B point correspondence and cut figure centre coordinate point, add up then mobile terminal screen included cut the figure number; The described figure of cutting number comprises that part is included in the figure that cuts in the mobile terminal screen;
Display device is used for by the attribute of the described figure of cutting described first figure that cuts that cuts set of graphs being plotted to centre coordinate place corresponding in the painting canvas, painting canvas is plotted in screen buffer, and is presented at mobile terminal screen.
Preset size and the displacement of Qie Tu and screen buffer in the embodiment of the invention by initial installation, mobile terminal screen, screen buffer, painting canvas is divided into cuts figure, the described figure of cutting has the amplification rank, the centre coordinate attribute, determine mobile terminal screen, screen buffer, the relative position of painting canvas, receive the UI trigger event by treating apparatus and determine the direction that map moves, determine the quantity that the vacancy of needs demonstration is cut figure according to the displacement that presets, only painting canvas need be repainted the corresponding centre coordinate place of painting canvas with the figure that cuts of screen buffer overlapping region vacancy, be plotted to screen buffer by display device from painting canvas, be shown to portable terminal again, improve drafting and show the efficient of cutting figure, improve the speed that I/O handles, solve screen and dodged screen, flower screen phenomenon improves the user and experiences; The vacancy of Hui Zhiing is cut figure and has been left this locality in if desired, does not then need remote download to cut figure, thereby reduces network access quantity.
Embodiment five
Fig. 8 is the concrete structure figure of a kind of map display system of the embodiment of the invention.
Described map display system comprises initial installation, treating apparatus, display device; Wherein display device comprises: judging unit, calculating and storage unit, drawing unit;
Initial installation; Be used for presetting size and the displacement of Qie Tu and screen buffer, mobile terminal screen, screen buffer, painting canvas be divided into cut figure, the described figure of cutting has the rank of amplification, centre coordinate attribute, determines the relative position of mobile terminal screen, screen buffer, painting canvas; Be further used for presetting first parameter, second parameter, described first and second parameter is positive integer, and initial value is 0;
Treating apparatus, when being used for receiving triggering command, calculating need be plotted in first quantity of cutting figure of described painting canvas, and deposits the attribute of described first quantity and the described figure of cutting in first and cut set of graphs; Wherein be used for calculating first quantity of cutting figure that need be plotted in described painting canvas is specially: receive and determine that painting canvas and screen buffer overlapping region vacancy cut the figure total quantity behind the trigger event; Or when landing map system first, first quantitative approach of cutting figure that calculating need be plotted in described painting canvas is: select the latitude and longitude coordinates of a geographic position A as the reference point, according to level of zoom and Qie Tu size, described map is divided into a plurality of figure of cutting; Need to show the map centered by the B of another one geographic position, then the mobile terminal screen central point be placed under the level of zoom B point correspondence and cut figure centre coordinate point, add up then mobile terminal screen included cut the figure number; The described figure of cutting number comprises that part is included in the figure that cuts in the mobile terminal screen;
Display device comprises:
Judging unit is used for judging one by one that by the attribute of the described figure of cutting first cuts cutting figure and whether being stored in this locality of set of graphs; Judge whether first parameter equals described first quantity; When first parameter is not equal to described first quantity, continue to cut cutting figure and whether be stored in this locality in the set of graphs by the determined property first of the described figure of cutting; Judge whether second parameter is 0;
Calculate and storage unit, be used for cutting figure and being stored in this locality when described judgment unit judges goes out one, described first parameter is added 1; Cut figure and be not stored in this locality when judging one, then this is cut the figure attribute and deposit second in and cut set of graphs, second parameter adds 1, the first parameter and adds 1; Be 0 when judging second parameter, obtain second to remote server and cut and cut cutting figure and storing this locality into of figure attribute correspondence in the set of graphs that the notifier processes unit continues to calculate first quantity of cutting figure that need be plotted in described painting canvas;
Drawing unit is used for cutting figure and being stored in this locality when described judgment unit judges goes out one, and this cuts the centre coordinate place that figure is plotted to the painting canvas correspondence; When judging first parameter and equaling described first quantity, painting canvas is plotted in screen buffer when described, is presented at mobile terminal screen.
In the embodiment of the invention except comprising network thread in the map downloader, other each modules run through the whole story by the UI thread, cut figure and screen buffer size by the initial installation setting, mobile terminal screen, screen buffer, painting canvas is divided into cuts figure, determine relative position, the UI event instruction that the management map device obtains according to the UI thread, calculating need be plotted in the first quantity N that cuts figure on the painting canvas and Qie Tu attribute and deposit first in and cut set of graphs, define the first parameter n and second parametric t, first judge module is judged one by one and is cut cutting figure and whether have this locality in the set of graphs, if, the map loading bin reads local cutting figure and storing scratchpad area (SPA) in the management map device into of preserving, be plotted to the centre coordinate place of painting canvas correspondence, second judge module judges whether n equals N, if, display device is plotted in screen buffer with painting canvas, be presented at mobile terminal screen, the vacancy that the needs are here drawn is cut figure and has been left this locality in, then do not need remote download to cut figure, and be earlier cutting the centre coordinate point that figure is plotted to the painting canvas correspondence, again painting canvas is plotted in screen buffer, and be presented at mobile terminal screen, improve drafting and show the efficient of cutting figure, improve the speed that I/O handles, solve screen and dodged screen, flower screen phenomenon improves the user and experiences, and also reduces network access quantity simultaneously; The 3rd judge module judges whether t equals 0, if not, the map downloader is cut the diagram data bag and is stored this locality into from the remote server download according to the second figure attribute of cutting in the set of graphs of cutting, have only the vacancy of need drawing to cut figure and do not leave in and locally just arrive the remote server download, thus the minimizing network access quantity.
Map display system provided by the invention can be applied to need to show on the portable terminal of map, for example mobile phone etc.