# opacity

return type | undefined
syntax | $( map or service selector ).geomap( "opacity", Number opacity )

usage

    $("#map").geomap( "opacity", .5 )
    $("#map .osm").geomap( "opacity", .7 )

This method sets the value of the opacity property of service objects in the services array.

It will also update the opacity of all images already requested by the service.

If you call opacity directly on geomap's div element, it will apply to all services. You can target individual services using a CSS selector based on the map div id and the class supplied for the service in its service object or just the id of the service if supplied in its service object.

    // for example, given the following as the map div
    <div id="map"></div>

    // and initializing geomap with the following services
    $("#map").geomap({
      services: [
        {
          id: "water",
          class: "mass-gis",
          type: "shingled",
          src: function ( view ) { return null; }
        },
        {
          id: "towns",
          class: "mass-gis",
          type: "shingled",
          src: function ( view ) { return null; }
        },
        {
          id: "harbor-cruise",
          type: "shingled",
          src: function ( view ) { return null; }
        }
      ]
    });

    // you can later change the opacity of all services
    $("#map").geomap("opacity", .8);

    // all mass-gis services
    $("#map .mass-gis").geomap("opacity", .5);

    // or a specific service
    $("#harbor-cruise").geomap("opacity", 1.0);

This is much faster than changing a service object's opacity value yourself and updating geomap's services property.