cherry pick changes from czmlLayers branch.