Multizmap Modification Instructions
Multizmap is based on the Baidu Map API encapsulation of some common function class library, mainly in the prototype way, and implemented some auxiliary functions, such as adding Marker function, event management, etc.
Previous version: Http://www.cnblogs.com/editor/category/591379.html
This new marker add function, support chain operation, and modify the printing function and ranging function;
Function description
1. Create a map
var New Multizmap ({ ' container ', ' mapId ' });
2. Marker operation
var new multimap.getpoint (' 118.523826,24.929245 '); var New Multimap.marker (pot) . SetLabel (' title ', {}) . SetIcon ({img:' xxxx.gif ', width:22, height:22 }); Multimap.panto (pot) ;
The Mke can return
itself get () method
Marker Label name: Getlabel ();
Icon method: GetIcon (); Returns the JSON data for the picture, width, height;
3. Printing function;
Print:function(opts) {/*var pot = Self.mapObj.getCenter (); var zoom = Self.mapObj.getZoom (); Opts.width = Opts.width | | 700; Opts.height = Opts.height | | 600; window.open (Opts.url + '? lng= ' +pot.lng+ ' &lat= ' +pot.lat+ ' &zoom= ' +zoom, ' Print map ', "height=" +opts.height+ ", Width= "+opts.width+", top=10, Left=10,toolbar=yes, Menubar=no, Scrollbars=yes, Resizable=yes, Location=no, Status=no " ); */ varwidth = $ (' # ' +self.container). width (); varHeight = $ (' # ' +self.container). Height (); varPrtfull =NewSelf . Xfullmap ({width:width, height:height, Fullfunc:function() { } }); varMidx =MultiZMap.dom.getMaxzIndex (); Prtfull.tofull (Self.mapObj.getCenter (), MIDX); Window.print (); SetTimeout (function() {Prtfull.toorigi (); }, 1000);}
This feature is under Tools:
method of Use;
Print full screen first, after printing will automatically back to restore the interface state;
SOURCE download
SOURCE Download: Http://files.cnblogs.com/editor/MultiZMap3.rar
The project source code using Springmvc+maven build, Src/main/webapps is the script source code;
[Baidu Map] Multizmap modified use;