Check the Directions API Terms of Service page which says:
Note: the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited
I believe that means you'll need to use the Google Maps API for your basemaps if you also wish to use their routing capability.
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
Best Answer
As stated in other answer, using google's map tile directly violates their TOS. If you are not married to Silverlight, you can approach this from a different angle and overlay arcgis services onto a google map instead of inserting a google basemap into an arcgis map.
This walks through the basic steps: http://help.arcgis.com/en/webapi/javascript/gmaps/help/google_start.htm#topics/gmaps_addmap.html
You still need to be compliant with google's TOS, but you have much greater flexibility when you build on top of google's gmap.