Today, when looking at the map of the day, there is a multi-phase map display function, feel very fun, as the technical control of my 10 o'clock home is fast 11 o'clock, it should be sleep, but, excited mood can not calm, hey, forget, the spirit of not staying up late programmer is not good programmer principle, Boil the night will finally see the desired effect, they can not wait to come out with you to share, first look at the effect of heaven and earth map and my effect:
Days Map Multi-phase effect
Days Map Multi-phase link: http://www.tianditu.cn/multidate/multidate.html?ll=116.38,39.92&l=11
Self-made effect
After reading the effect, the following is the implementation of the specific functions. 1, the linkage of the map: the map of Map 2 (1) changes when the extent of the local Figure 1 (2) changes, and the map 2 (1) is the same as the map 1 (2), 2, the mouse linkage: when the mouse moves on map 1 (2), the mouse pointer position is displayed in the same location as the map 2 (1).
Above, the analysis of the function, the following talk about the realization of ideas. 1, Map linkage: Local Figure 1 (2) when the scope of the change, get map 1 (2) range, and set 2 (1) Range of map 1 (2), 2, mouse linkage: Mouse on map 1 (2) move, get the mouse map point coordinates, and on map 2 (1) display mouse.
The example of the implementation of map 1 to map 2 linkage, map 2 to map 1 linkage has not been realized, follow-up will continue to update, but also hope to continue to pay attention to Lzugis CSDN blog, hoping to bring you more sharing. The specific implementation code is as follows:
<! DOCTYPE html>
Arcgis for JavaScript implements linkage of two maps