5 Replies - 625 Views - Last Post: 02 September 2013 - 03:42 AM

#1 Monte Carbo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-September 13

With this script, what do I need to change in order to get a different

Posted 01 September 2013 - 03:05 PM

The code below is from https://developers.g...ps/docum…
which is meant to be used for adding a custom overlay image in Google Maps with Google API v3. I've been looking at it for awhile and can't figure out what I need to change in order to get a full country image rather than one small little building. I'd also like to switch the image. Any help you can offer would be much appreciated.
<!DOCTYPE html>
<html>
<head>
<title>Overlaying an image map type</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script src="https://maps.googleapis.com/maps/ap…
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 18,
center: new google.maps.LatLng(37.78313383212, -122.4039494991302),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById(…
mapOptions);

var bounds = {
17: [[20969, 20970], [50657, 50658]],
18: [[41939, 41940], [101315, 101317]],
19: [[83878, 83881], [202631, 202634]],
20: [[167757, 167763], [405263, 405269]]
};

var imageMapType = new google.maps.ImageMapType({
getTileUrl: function(coord, zoom) {
if (zoom < 17 || zoom > 20 ||
bounds[zoom][0][0] > coord.x || coord.x > bounds[zoom][0][1] ||
bounds[zoom][1][0] > coord.y || coord.y > bounds[zoom][1][1]) {
return null;
}

return ['http://www.gstatic.com/io2010maps/tiles/…
zoom, '_', coord.x, '_', coord.y, '.png'].join('');
},
tileSize: new google.maps.Size(256, 256)
});

map.overlayMapTypes.push(imageMapType);

}

google.maps.event.addDomListener(windo… 'load', initialize);

</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>


This post has been edited by macosxnerd101: 01 September 2013 - 04:11 PM
Reason for edit:: Please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: With this script, what do I need to change in order to get a different

#2 CasiOo  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1428
  • View blog
  • Posts: 3,171
  • Joined: 05-April 11

Re: With this script, what do I need to change in order to get a different

Posted 01 September 2013 - 03:28 PM

Moving Javascript right below Java in the menu might help. Javascript isn't just for web development either

This post has been edited by CasiOo: 01 September 2013 - 03:29 PM

Was This Post Helpful? 0
  • +
  • -

#3 Monte Carbo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-September 13

Re: With this script, what do I need to change in order to get a different

Posted 01 September 2013 - 03:34 PM

View PostCasiOo, on 01 September 2013 - 03:28 PM, said:

Moving Javascript right below Java in the menu might help.


What exactly do you mean by this?
Was This Post Helpful? 0
  • +
  • -

#4 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 8029
  • View blog
  • Posts: 13,741
  • Joined: 19-March 11

Re: With this script, what do I need to change in order to get a different

Posted 01 September 2013 - 03:49 PM

He means this is not java, it's javascript. They're completely different languages. That's why I'm moving this to the javascript forum.
Was This Post Helpful? 0
  • +
  • -

#5 Monte Carbo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-September 13

Re: With this script, what do I need to change in order to get a different

Posted 01 September 2013 - 04:04 PM

Ah. Thanks.

This post has been edited by Dormilich: 04 September 2013 - 01:27 AM

Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3835
  • View blog
  • Posts: 13,583
  • Joined: 12-December 12

Re: With this script, what do I need to change in order to get a different

Posted 02 September 2013 - 03:42 AM

Monte Carbo The link in your first post is broken, and the code can't be run as there are several ... breaks in it.

However, we need to know that you have gone beyond "looking at it for awhile". You need to:

  • Read the documentation
  • Run the sample code - get it working
  • Make sure you understand how the sample works
  • Attempt to make a few changes to the code

Once you've done this, and can post the code that you are now working with, then someone can probably help you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1