| New file |
| | |
| | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta http-equiv="content-type" content="text/html; charset=utf-8"/> |
| | | <title>My Map Set Name (Google Maps Export from Global Mapper)</title> |
| | | <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> |
| | | <script type="text/javascript"> |
| | | |
| | | var G = google.maps; |
| | | var map; |
| | | |
| | | var customMapType = new G.ImageMapType |
| | | ( |
| | | { |
| | | getTileUrl: function(coord, zoom) |
| | | { |
| | | var normalizedCoord = getNormalizedCoord(coord, zoom); |
| | | if (!normalizedCoord) { return null; } |
| | | |
| | | if ( zoom == 1 && normalizedCoord.x >= 1 && normalizedCoord.x <= 1 && normalizedCoord.y >= 0 && normalizedCoord.y <= 0 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 2 && normalizedCoord.x >= 3 && normalizedCoord.x <= 3 && normalizedCoord.y >= 1 && normalizedCoord.y <= 1 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 3 && normalizedCoord.x >= 6 && normalizedCoord.x <= 7 && normalizedCoord.y >= 2 && normalizedCoord.y <= 4 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 4 && normalizedCoord.x >= 12 && normalizedCoord.x <= 15 && normalizedCoord.y >= 4 && normalizedCoord.y <= 8 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 5 && normalizedCoord.x >= 24 && normalizedCoord.x <= 31 && normalizedCoord.y >= 8 && normalizedCoord.y <= 16 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 6 && normalizedCoord.x >= 48 && normalizedCoord.x <= 63 && normalizedCoord.y >= 16 && normalizedCoord.y <= 32 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 7 && normalizedCoord.x >= 96 && normalizedCoord.x <= 127 && normalizedCoord.y >= 32 && normalizedCoord.y <= 64 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 8 && normalizedCoord.x >= 192 && normalizedCoord.x <= 255 && normalizedCoord.y >= 64 && normalizedCoord.y <= 128 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 9 && normalizedCoord.x >= 384 && normalizedCoord.x <= 511 && normalizedCoord.y >= 128 && normalizedCoord.y <= 256 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 10 && normalizedCoord.x >= 768 && normalizedCoord.x <= 1023 && normalizedCoord.y >= 256 && normalizedCoord.y <= 512 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | else if ( zoom == 11 && normalizedCoord.x >= 1536 && normalizedCoord.x <= 2047 && normalizedCoord.y >= 512 && normalizedCoord.y <= 1024 ) |
| | | { |
| | | return "file:///G://ÐÅÖÝÇøÕýÉä³É¹û´æµµ//ÇÐÆ¬²âÊÔ//11¼¶ÇÐÆ¬È«//Z" + zoom + "/" + normalizedCoord.y + "/" + normalizedCoord.x + ".png"; // replace that with a "real" URL |
| | | } |
| | | return null; |
| | | }, |
| | | |
| | | alt: "My Map Set Name", |
| | | tileSize: new G.Size(256, 256), |
| | | isPng: true, |
| | | maxZoom: 11, |
| | | minZoom: 1, |
| | | opacity: 1.00, |
| | | name: "My Map Set Name" |
| | | } |
| | | ) |
| | | |
| | | function getNormalizedCoord(coord, zoom) |
| | | { |
| | | var y = coord.y; |
| | | var x = coord.x; |
| | | |
| | | var tileRange = 1 << zoom; |
| | | |
| | | if (y < 0 || y >= tileRange) { return null; } |
| | | if (x < 0 || x >= tileRange) |
| | | { |
| | | x = (x % tileRange + tileRange) % tileRange; |
| | | } |
| | | |
| | | return { x: x, y: y }; |
| | | } |
| | | |
| | | function initialize() |
| | | { |
| | | var myLatlng = new G.LatLng(33.256630,135.000000); |
| | | var myOptions = { |
| | | center: myLatlng, |
| | | zoom: 1, |
| | | mapTypeId: G.MapTypeId.ROADMAP, |
| | | mapTypeControl: true, |
| | | overviewMapControl: false, |
| | | scaleControl: false, |
| | | streetViewControl: true, |
| | | panControl: true, |
| | | zoomControl: true, |
| | | zoomControlOptions: { style: google.maps.ZoomControlStyle.DEFAULT } |
| | | }; |
| | | |
| | | map = new G.Map(document.getElementById("map_canvas"), myOptions); |
| | | map.overlayMapTypes.insertAt(0, customMapType); |
| | | } |
| | | </script> |
| | | </head> |
| | | <body onload="initialize()"> |
| | | <div id="map_canvas" style="width: 100%; height: 800px; margin: 0px 0px 0px 0px; float: middle;"></div> |
| | | </body> </html> |