Giter Site home page Giter Site logo

wmsmaptype's Introduction

WMS MapType

JavaScript library for overlaying WMS content on Google Maps (v3).

Mimics a tiling web service by calculating the Web Spherical Mercator (EPSG:3857, EPSG:900913) bounding box of the visible tiles.

Uses include overlaying weather data (radar, warnings, storm forecasts), satellite imagery, landmarks, topographic features, and other WMS provided content.

Usage

Create a new WMS MapType using the following constructor.

WmsMapType(name, url, params[, options])
  • name:string: (Required) Name of the MapType
  • url:string: (Required) Base URL for the WMS
  • params:object: (Required) Key/value pairs representing WMS params (e.g. layers)
  • service: The service type [default: 'WMS']
  • version: The service version [default: '1.1.1']
  • request: The service request [default: 'GetMap']
  • format: The image format [default: 'image/png']
  • transparent: Transparent image [default: true]
  • width: The image width [default: 256]
  • height: The image heigh [default: 256]
  • srs: The projection [default: 'EPSG:3857']
  • styles: The WMS style(s) [default: '']
  • layers: (Required) The WMS layer(s) [default: '']
  • options:object: Extra options for library (e.g. opacity)
  • opacity: The tile opacity [default: 0.5]
  • cache: Cache WMS requests [default: false]

Add to a base map using the following method.

addToMap(map[, index])
  • map:google.maps.Map: (Required) Base map
  • index:int: Optional layer index

Remove from a base map using the following method.

removeFromMap(map)
  • map:google.maps.Map: (Required) Base map

Example

var wxRadar = new WmsMapType(
        "NOAA Radar",
        "http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs",
        {layers: "RAS_RIDGE_NEXRAD"},
        {opacity: 0.7});

var wxWarnings = new WmsMapType(
        "IEM Warnings",
        "http://mesonet.agron.iastate.edu/cgi-bin/wms/us/wwa.cgi",
        {layers: "warnings_p,warnings_c"});

wxRadar.addToMap(map);
wxWarnings.addToMap(map);

Notes

Currently optimized for WMS 1.1.1 and does not support WMS 1.3.0 params.

The WMS must support EPSG:3857 or EPSG:900913 SRS.

Acknowledgements

Credit goes to the following resources.

Etc

Beau Grantham
http://pgp.nologs.org/6EA6595C.asc

wmsmaptype's People

Contributors

beaugrantham avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.