how i order it. use
insertAt
first i create layer in object like this.
layer = {};
layer.nrcs_soils= new google.maps.ImageMapType({
getTileUrl: function (coord, zoom) {
return getTileWmsUrl(coord, zoom, "nrcs_soils");
},
tileSize: new google.maps.Size(256, 256),
opacity: 1,
name:'nrcs_soils',
alt:{
layer_name:'nrcs_soils'
,order : 0
},
isPng: true
});
after that i create simple function add layer to map.
add_layer = function(layer_name){
//-- get order from object layer
var order_layer =layer[layer_name].alt.order;
map.overlayMapTypes.insertAt(order_layer ,layer[layer_name]);
}
just call this function for add and order layer from your setting on your object layer.
add_layer("nrcs_soils");
or use splice
concept like this.
array = [ 'My', 'name', 'Ruthe' ];
array.splice(1,0,"sur");
console.log('array : '+array); //array : My,sur,name,Ruthe
Google Static map api requires centre,lat/lng and pixel size as well as zoom level
This is a non-JavaScript version (but python) for working out the pixel dimensions.
You will need to modify to suit your needs but the key point is that it contains
CalculateBoundsZoomLevel
Which take a cluster of points and calculate the zoom level and centre of the map required.
This method is used to take in a bounding box (southwest and northeast
bounds of the map view we want) and a map size and it will return us a zoom
level for our map. We use this because if we take the bottom left and
upper right on the map we want to show, and calculate what pixels they
would be on the map for a given zoom level, then we can see how many pixels
it will take to display the map at this zoom level. If our map size is
within this many pixels, then we have the right zoom level.
http://code.google.com/p/google-ajax-examples/source/browse/trunk/nonjslocalsearch/localSearch.py
Best Answer
In http://www.zolnai.ca/WMS/whereintheworldV3.htm you are missing the following:
Proper reference to the google maps api library. From v3 there is no need for an api key so the reference would look like this:
There is no need for "new google.maps.Icon". You can simply use gicons["pink"]="0pink_Marker.PNG";
"new google.maps.Marker(point, gicons[icontype]);" is completely wrong syntax in v3. The right way of defining your marker would be: "new google.maps.Marker({position:point, icons:gicons[icontype]});" That is because in v3, the marker object requires a list of options in a javascript object literal, which in your case is: {position:point,icon:gicons[icontype]}
I am watching the code right now but it seems to me your code is a perfect mixture ofthe two versions. I recommend you checking the v3 api and picking it up!