Baidu Map Custom Layer----Bmaptilecutterjava Chettu Tools Network version __java

Source: Internet
Author: User
Tags pow java web

Http://www.makaidong.com/%E5%8D%9A%E5%AE%A2%E5%9B%AD%E7%89%9B/31781.shtml


Recently do Baidu map API-related application development, need to overlay their maps to Baidu map above, to see the official Baidu API description of the JavaScript section, do not have a good explanation of how to cover the interface.

Looking for relevant articles on the Internet to see the next, (http://www.makaidong.com/jz1108/archive/2011/10/08/2202239.html) This article to achieve this Chettu function, but the latest Baidu The highest scaling level of 19, the project needs, but only their own to write a map development tools.

Refer to another article by the same author (http://www.makaidong.com/jz1108/archive/2011/07/02/2095376.html), specifically speaking of Baidu coordinate system development.

Program is implemented in Java Web, struts 2 file tag and simple JS call.

Implementing Core Code

1.tileutils.java

  1 package Com.xiefei.core;
  2 3 Import java.awt.graphics2d;
  4 Import Java.awt.image;
  5 Import Java.awt.toolkit;
  6 Import java.awt.transparency;
  7 Import Java.awt.image.bufferedimage;
  8 Import Java.awt.image.cropimagefilter;
 9 Import Java.awt.image.filteredimagesource;
 Import Java.awt.image.imagefilter;
 Import Java.io.file;
 Import Javax.imageio.imageio;
 The public class Tileutils {private int minlevel;
 the private int maxlevel;
 a private int piclevel;
 Private double Mercatorx;
 Private double mercatory;
 private string pic;
 private string Savepath;         Public Tileutils (string pic, double Mercatorx, double mercatory, string savepath) {26
 This.pic = pic;
 This.mercatorx = Mercatorx;
 This.mercatory = mercatory;
 This.savepath = Savepath; Public Tileutils (string pic, int minlevel, int maxlevel, int piclevel, DoubLe Mercatorx, double mercatory, string savepath) {this.pic = pic;
 This.minlevel = MinLevel;
 This.maxlevel = Maxlevel;
 Panax Notoginseng This.mercatorx = Mercatorx;
 This.mercatory = mercatory;
 This.savepath = Savepath;
 This.piclevel = Piclevel;  Cutterall public void () throws exception {(int i = minlevel; I <= maxlevel; i++)
 {Cutterone (i); Cutterone (int level) throws exception {50//pixel coordinates of the center of the picture (Pixelx,pix Ely), the picture Center plane coordinates namely the magic Cato coordinates (Mercatorx, mercatory) 51//pixel coordinates = plane coordinates * MATH.POW (2, level-18) Double Pixelx
 = Mercatorx * MATH.POW (2, level-18);
 Double pixely = mercatory * MATH.POW (2, level-18);
 System.out.println ("Pixelx:" + pixelx);
 System.out.println ("pixely:" + pixely); BufferedImage bi = imageio.read (

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.