ArcGIS API for JavaScript: Core/Intersectlayers (MapServer)
Built using the ArcGIS API for JavaScript