Google map API V3 calls the ArcGIS published tile map Service

Source: Internet
Author: User

Because the recent project needs to use a CAD-made map, but has been using the Google Offline tile map, how to map the CAD image with the same zoom, mobile functions put on the page display as a problem,

The original Google map of the code can not be used? How long does it take to re-write a set of code, and how much time and effort?

So began to try N methods, the last to find may be the best way to follow the existing code, the method is: the first to use ArcGIS software, the CAD diagram into an mxd file (of course, the difficulties are not mentioned, and the effect of the conversion may not be the same as the CAD),

Finally asked is the study of geographic information System Professional friends just to fix. Second, publish the MXD as a GIS service, need to generate tile files, if the publication successfully access http://localhost/ArcGIS/rest/services/service name/mapserver will display the corresponding map information,

Finally, use the following Google Map script file to call the corresponding URL

           //Set Center location        varMycenter =NewGoogle.maps.LatLng (34.573380321227, 115.42915725708); functionCoordmaptype () {} CoordMapType.prototype.tileSize=NewGoogle.maps.Size (256, 256); CoordMapType.prototype.maxZoom= 15; CoordMapType.prototype.minZoom= 11; CoordMapType.prototype.getTile=function(coord, Zoom, ownerdocument) {varimg = ownerdocument.createelement ("img"); Img.style.width= This. Tilesize.width + "px"; Img.style.height= This. Tilesize.height + "px"; varstrURL = "http://localhost/ArcGIS/rest/services/Service name/mapserver/tile/" + zoom + "/" + Coord.y + "/" +coord.x; IMG.SRC=strURL; returnimg;        }; CoordMapType.prototype.name= "Tile #s"; CoordMapType.prototype.alt= "Tile coordinate Map Type"; functionGetcoordinatemaptype () {return NewCoordmaptype (); }        //Initialize Map        functionInitialize () {varMapoptions ={zoom:11, Center:mycenter, Maptypeid:"Coordinate"            }; Variable.map=NewGoogle.maps.Map (document.getElementById ("Map_canvas"), mapoptions); Variable.map.mapTypes.set (' Coordinate ', Getcoordinatemaptype ()); }

HTML code

<div id= "Map_canvas" ></div>

Google map API V3 calls the ArcGIS published tile map Service

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.