added a addOrReplace applayer and service function in viewercontroller