How to add terrain to custom gmap

174 views
Skip to first unread message

Niklas Rosencrantz

unread,
Aug 18, 2011, 6:51:31 PM8/18/11
to google-map...@googlegroups.com

The link to my map is montao.com.br is the map I want to make dynamic is attached with this message. I could mape a styled map but some features were undoable such as remove other countries than Brazil, the red dots for the city but recently it says the API was updated and now it's possible to add terrain to the custom map but I can't find a reference how to do it. If you follow the link you map the map and the javascript and maybe you know how to do it? Thank you /Niklas R


en4ce

unread,
Aug 19, 2011, 4:30:39 AM8/19/11
to Google Maps JavaScript API v3
this map type is called Relief not terrain, take a look at my page
youspots.com, we have such a layer and you can create it like this:

var reliefMap = new google.maps.ImageMapType({
getTileUrl: function(a, b) {
return "http://maps-for-free.com/layer/relief/z" + b + "/row" +
a.y + "/" + b +
"_" + a.x + "-" + a.y + ".jpg"; },
tileSize: new google.maps.Size(256, 256),
isPng: false,
minZoom: 0,
maxZoom: 11,
name: "Relief",
alt: "Relief layer"
});

to enable the layer in a custom control do something like this:

map.mapTypes.set("relief", reliefMap);
map.setMapTypeId('relief');


On 19 Aug., 00:51, Niklas Rosencrantz <nikla...@gmail.com> wrote:
> <https://lh5.googleusercontent.com/-9Yu9Pua-adA/Tk2WtJH7T-I/AAAAAAAAA7...>

Niklas Rosencrantz

unread,
Aug 19, 2011, 9:52:54 AM8/19/11
to google-map...@googlegroups.com
Thanks en4ce! I bookmarked your page youspots.com since it's really nice.
I could get the reliefMap enabled but then I couldn't style it i.e.
make water dark and make names of cities and areas appear etc.
Is it possible to create a style with a relief map like the one I attach?
I could get KML markers combined with reliefMap using the javascript
you sent but I'm lost for how to make the water dark and make the
borders yellow etc.
Can you recommend how to progress? The gmap is starting to look nice
but I want to make it look more like the original that isn't dynamic
but has dark water, yellow borders, red dots for cities, etc

Any other suggestions? The link to my map is montao.com.br

gmap.png
original.jpeg
Reply all
Reply to author
Forward
0 new messages