Print large map on Google Maps
Is there any way that we can print a large map with all the pins on google maps? EG: there are around 300 pins with places of interest and can we print out a large map (4000 x 6000) PDF and use A0 printer to print the results?
Lets say that the entire UK fits into the A0 page with differen开发者_如何转开发t pins on the map.
Thanks.
I don't know if this helps, but looking at the Google Maps API, you could try something like this:
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(54,-3);
var myOptions = {
zoom: 9,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:4000px; height:6000px"></div>
</body>
</html>
The key thing here is setting the width and height of map_canvas in pixels, so they exceed the size of your browser window. From here on, hopefully it's a question of getting your print settings right to print the whole image.
The Google Maps API is not intended for high-resolution printing. On the other hand Google Earth Pro boasts high-resolution printing (up to 4,800 horizontal pixels) as one of the main features.
You may want to consider using KML in order to display your markers on both Google Maps and Google Earth. The following articles may help you getting started:
- Google Maps KML Support
- KML Tutorial
- Wikipedia: Keyhole Markup Language
The following is an example KML document:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>New York City</name>
<description>New York City</description>
<Point>
<coordinates>-74.006393,40.714172,0</coordinates>
</Point>
</Placemark>
</kml>
This might help you get started (it draws a big map).
Once you have that, you could use the Google Maps API to draw on the pins.
精彩评论